}
- if (cfh.ext_attrs & EXT_ATTR_DIR || (p = strrchr (cfh.name, '/'))) {
+ p = cfh.name;
+
+#if defined (_WIN32)
+
+ while ((p = strchr (p, '/'))) {
+ *p++ = '\\';
+ }
+
+#endif
+
+ if (cfh.ext_attrs & EXT_ATTR_DIR || (p = strrchr (cfh.name, ch))) {
if (p) { *p = '\0'; }
report_at (program_name, 0, REPORT_ERROR, "not enough free memory for name");
- if (p) { *p = '/'; }
+ if (p) { *p = ch; }
break;
}
report_at (program_name, 0, REPORT_ERROR, "not enough free memory for name");
- if (p) { *p = '/'; }
+ if (p) { *p = ch; }
break;
}
}
+ if (temp[strlen (temp) - 1] == ch) {
+ temp[strlen (temp) - 1] = '\0';
+ }
+
#if defined (unix) || defined (__unix) || defined (__unix__) || defined (__APPLE__)
if (!stat (temp, &sb)) {
free (temp);
break;
- } else {
- printf (" creating: %s%c\n", temp, ch);
}
+ } else {
+ printf (" creating: %s%c\n", temp, ch);
}
#endif
}
- if (p) { *p = '/'; }
+ if (p) { *p = ch; }
free (temp);
- if (cfh.ext_attrs & EXT_ATTR_DIR || cfh.name[cfh.name_len - 1] == '/') {
+ if (cfh.ext_attrs & EXT_ATTR_DIR || cfh.name[cfh.name_len - 1] == ch) {
free (cfh.name);