#define CB_SIZE (COPY_BLOCKS * BLOCKSIZE)
-signed long read_cb (struct filesystem *fs, struct inode_pos *ipos, signed long size, void *data) {
+static signed long read_cb (struct filesystem *fs, struct inode_pos *ipos, signed long size, void *data) {
signed long remaining_size = size;
}
-unsigned long mkfile_fs (struct filesystem *fs, unsigned long parent_nod, const char *name, void *data, unsigned long size, unsigned short uid, unsigned short gid, unsigned long ctime, unsigned long mtime) {
+static unsigned long mkfile_fs (struct filesystem *fs, unsigned long parent_nod, const char *name, void *data, unsigned long size, unsigned short uid, unsigned short gid, unsigned long ctime, unsigned long mtime) {
unsigned long nod;
}
-static void copy_file (struct filesystem *fs, FILE *fp, unsigned long parent_nod, char *fn) {
+static void copy_file (struct filesystem *fs, FILE *fp, unsigned long parent_nod, char *target) {
unsigned long bytes = 0, timestamp = time (0), nod;
- char *basename = fn, *p;
+ char *basename = target, *p;
- if ((p = strrchr (fn, '/')) || (p = strrchr (fn, '\\'))) {
+ if ((p = strrchr (target, '/')) || (p = strrchr (target, '\\'))) {
basename = (p + 1);
}
static void walk_dir (struct filesystem *fs, char *dirname) {
- unsigned long parent_nod = EXT2_ROOT_INO;
- unsigned long timestamp = time (0);
+ unsigned long parent_nod = EXT2_ROOT_INO, timestamp = time (0);
+ char *p1 = dirname, *p2, saved_ch;
- char *p1 = dirname, *p2;
-
- while (*p1 && *p1 == '/') {
+ while (*p1 && (*p1 == '/' || *p1 == '\\')) {
p1++;
}
if (*p1) {
- for (; (p2 = strchr (p1, '/')); p1 = p2 + 1) {
+ for (; (p2 = strchr (p1, '/')) || (p2 = strchr (p1, '\\')); p1 = p2 + 1) {
+ saved_ch = *p2;
*p2 = '\0';
if (strlen (p1) >= 14) {
report_at (program_name, 0, REPORT_ERROR, "cannot access '%s'", dirname);
- *p2 = '/';
+ *p2 = saved_ch;
return;
}
- *p2 = '/';
+ *p2 = saved_ch;
}