Changeset 1692


Ignore:
Timestamp:
Aug 11, 2013, 7:11:59 PM (12 years ago)
Author:
Gregg Young
Message:

Fix failure to create directory from archive file name when the name had a space. Strip extra leading " in extract and remove it from the arc container since it wasn't selectable and doesn't really make sense in that context (at least to me) Ticket 495

Location:
trunk/dll
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/arccnrs.c

    r1690 r1692  
    29622962        if (dcd->directory && fFileNameCnrPath &&
    29632963            stricmp(lastextractpath, dcd->directory)) {
    2964           strcpy(lastextractpath, dcd->directory);
     2964          strcpy(lastextractpath, dcd->directory);
     2965          //DbgMsg(pszSrcFile, __LINE__, "Extract dir %s", dcd->directory);
    29652966          SetDir(dcd->hwndParent, hwnd, dcd->directory, 1);
    29662967        }
     
    36763677          else
    36773678            strcpy(dcd->directory, extractpath);
    3678         }
    3679         if (!*dcd->directory && fFileNameCnrPath && dcd->arcname) {
     3679        }
     3680        // Removed because it can't be set from inside the container and names with a space
     3681        // break it. I don't think it makes sense from the container any way GKY 8-10-13
     3682        /*if (!*dcd->directory && fFileNameCnrPath && dcd->arcname) {
    36803683          strcpy(fullname, dcd->arcname);
    36813684          p = strrchr(fullname, '.');
    3682           if (p)
    3683            *p = 0;
     3685          if (p) {
     3686            *p = 0;
     3687          }
    36843688          else {
    36853689            p = fullname + strlen(fullname);
    3686             p--;
    3687             *p = 0;
     3690            p--;
     3691            *p = 0;
    36883692          }
    36893693          strcpy(dcd->directory, fullname);
    3690         }
     3694        } */
    36913695        if (!*dcd->directory && *lastextractpath) {
    36923696          //DosEnterCritSec();  //GKY 11-29-08
  • trunk/dll/extract.c

    r1546 r1692  
    153153        strcpy(FileName, arcdata->arcname);
    154154        p = strrchr(FileName, '.');
    155         if (p)
     155        if (p) {
    156156          *p = 0;
     157          if (strchr(FileName, '\"'))
     158            memmove(FileName, FileName + 1, strlen(FileName) + 1);
     159        }
    157160        else {
    158161          p = FileName + strlen(arcdata->arcname);
    159162          p--;
    160163          *p = 0;
     164          if (strchr(FileName, '\"'))
     165            memmove(FileName , FileName + 1, strlen(FileName) + 1);
    161166        }
    162167        strcpy(arcdata->extractdir, FileName);
     
    296301          strcpy(FileName, arcdata->arcname);
    297302          p = strrchr(FileName, '.');
    298           if (p)
    299            *p = 0;
     303          if (p) {
     304            *p = 0;
     305            if (strchr(FileName, '\"'))
     306            memmove(FileName, FileName + 1, strlen(FileName) + 1);
     307          }
    300308          else {
    301309            p = FileName + strlen(arcdata->arcname);
    302310            p--;
    303311            *p = 0;
     312            if (strchr(FileName, '\"'))
     313            memmove(FileName, FileName + 1, strlen(FileName) + 1);
    304314          }
    305315          strcpy(arcdata->extractdir, FileName);
Note: See TracChangeset for help on using the changeset viewer.