From: Pierre Schweitzer Date: Sun, 26 Feb 2017 14:31:01 +0000 (+0000) Subject: [CABINET] X-Git-Tag: ReactOS-0.4.4-CLT2017~164 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=3e49feb4e7c40b4d0140d949bb8d36312545c7fe [CABINET] Fix handling of trailing backslash. Patch by Thomas Faber. ROSTESTS-135 svn path=/trunk/; revision=73926 --- diff --git a/reactos/dll/win32/cabinet/cabinet_ros.diff b/reactos/dll/win32/cabinet/cabinet_ros.diff new file mode 100644 index 00000000000..ed750813a4e --- /dev/null +++ b/reactos/dll/win32/cabinet/cabinet_ros.diff @@ -0,0 +1,29 @@ +Index: fdi.c +=================================================================== +--- fdi.c (revision 73922) ++++ fdi.c (working copy) +@@ -2039,11 +2039,24 @@ + fullpath[0] = '\0'; + if (pathlen) { + strcpy(fullpath, userpath); ++#ifndef __REACTOS__ + if (fullpath[pathlen - 1] != '\\') + strcat(fullpath, "\\"); ++#else ++ if (fullpath[pathlen - 1] == '\\') ++ fullpath[pathlen - 1] = '\0'; ++#endif + } ++#ifndef __REACTOS__ + if (filenamelen) ++#else ++ if (filenamelen) { ++ strcat(fullpath, "\\"); ++#endif + strcat(fullpath, cab->mii.nextname); ++#ifdef __REACTOS__ ++ } ++#endif + + TRACE("full cab path/file name: %s\n", debugstr_a(fullpath)); + diff --git a/reactos/dll/win32/cabinet/fdi.c b/reactos/dll/win32/cabinet/fdi.c index 2ff5dd99e3d..250ff1b2e3f 100644 --- a/reactos/dll/win32/cabinet/fdi.c +++ b/reactos/dll/win32/cabinet/fdi.c @@ -2039,11 +2039,24 @@ static int fdi_decomp(const struct fdi_file *fi, int savemode, fdi_decomp_state fullpath[0] = '\0'; if (pathlen) { strcpy(fullpath, userpath); +#ifndef __REACTOS__ if (fullpath[pathlen - 1] != '\\') strcat(fullpath, "\\"); +#else + if (fullpath[pathlen - 1] == '\\') + fullpath[pathlen - 1] = '\0'; +#endif } +#ifndef __REACTOS__ if (filenamelen) +#else + if (filenamelen) { + strcat(fullpath, "\\"); +#endif strcat(fullpath, cab->mii.nextname); +#ifdef __REACTOS__ + } +#endif TRACE("full cab path/file name: %s\n", debugstr_a(fullpath));