11) removed silly debug message

2) fixed problem with unarchiving files containing shell globbing characters

CVS patchset: 332
CVS date: 1996/02/19 23:34:25
This commit is contained in:
ewt 1996-02-19 23:34:25 +00:00
parent 89a31f02cd
commit 6ff596b90a
1 changed files with 19 additions and 4 deletions

View File

@ -96,6 +96,8 @@ int rpmInstallPackage(char * prefix, rpmdb db, int fd, int flags,
int prefixLength = strlen(prefix);
char ** prefixedFileList = NULL;
struct replacedFile * replacedList = NULL;
char * sptr, * dptr;
int length;
rc = pkgReadHeader(fd, &h, &isSource);
if (rc) return rc;
@ -250,10 +252,25 @@ int rpmInstallPackage(char * prefix, rpmdb db, int fd, int flags,
}
if (installFile) {
/* +1 cuts off leading / */
/* 1) we skip over the leading /
2) we have to escape globbing characters :-( */
length = strlen(fileList[i]);
files[archiveFileCount].fileName = alloca((length * 2) + 1);
dptr = files[archiveFileCount].fileName;
for (sptr = fileList[i] + 1; *sptr; sptr++) {
switch (*sptr) {
case '*': case '[': case ']': case '?': case '\\':
*dptr++ = '\\';
/*fallthrough*/
default:
*dptr++ = *sptr;
}
}
*dptr++ = *sptr;
files[archiveFileCount].fileName = fileList[i] + 1;
files[archiveFileCount].size = fileSizesList[i];
archiveFileCount++;
}
}
@ -982,8 +999,6 @@ static int markReplacedFiles(rpmdb db, struct replacedFile * replList) {
secOffset = 0;
} else {
secHeader = copyHeader(sh); /* so we can modify it */
printf("old size: %d new size: %d\n", sizeofHeader(sh),
sizeofHeader(secHeader));
freeHeader(sh);
}