- Fixes regression from commit
23167c3ea459405c98d8e759993efb6d9b1ea7f3
which causes all %dir entries to have a trailing slash, breaking
at least dependencies on such directories and probably something
else as well.
static rpmRC addFile(FileList fl, const char * diskPath,
struct stat * statp)
{
- const char *cpioPath = diskPath;
+ size_t plen = strlen(diskPath);
+ char buf[plen + 1];
+ const char *cpioPath;
struct stat statbuf;
mode_t fileMode;
uid_t fileUid;
gid_t fileGid;
const char *fileUname;
const char *fileGname;
+
+ /* Strip trailing slash. The special case of '/' path is handled below. */
+ if (plen > 0 && diskPath[plen - 1] == '/') {
+ diskPath = strcpy(buf, diskPath);
+ buf[plen - 1] = '\0';
+ }
+ cpioPath = diskPath;
+
/* Path may have prepended buildRoot, so locate the original filename. */
/*