[CABINET]

Fix handling of trailing backslash.
Patch by Thomas Faber.

ROSTESTS-135

svn path=/trunk/; revision=73926
This commit is contained in:
Pierre Schweitzer 2017-02-26 14:31:01 +00:00
parent 298e2fb71c
commit 3e49feb4e7
2 changed files with 42 additions and 0 deletions

View file

@ -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));

View file

@ -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));