Antonin Kral wrote:
> Hello Joey,
> 
> thank you. Could you send me the patch? Attachment, which I have
> received has zero length.

Hu?  Next try.

Regards,

        Joey

-- 
It's time to close the windows.

Please always Cc to me when replying to me on the lists.
diff -u fmirror-0.8.4/fmirror.c fmirror-0.8.4/fmirror.c
--- fmirror-0.8.4/fmirror.c
+++ fmirror-0.8.4/fmirror.c
@@ -1119,7 +1119,7 @@
     }
 dirdone:
     if (gotodir) {
-	cmd("CWD %s", "..");
+	cmd("CWD %s", gotodir);
 	if (!success()) {
 		LOG(0, failure, ("Could not CWD to '..', aborting"));
 		exit(EXIT_FAILURE);
@@ -1622,6 +1622,10 @@
 {
     int err;
     char dname[2048];
+
+    if (!strlen(name))
+      return 0;
+
     strncpy(dname, name, sizeof(dname));
     dname[sizeof(dname) - 1] = 0;
     if (verbosity < 2) {
@@ -2335,7 +2339,7 @@
 	free(p.linkname);
 	free(p.filename);
     } else {
-	if (line[len] == ':' && strcmp("./:", line) && strcmp(".:", line)) {
+	if (line[len] == ':' && strcmp("./:", line) && strcmp(".:", line) && strcmp(":", line)) {
 	    /* entering new directory, delete all files that are still
 	     * in the hash-table */
 	    int n;
@@ -2400,6 +2404,7 @@
     struct sockaddr_in sad;
     FILE *stream;
     char line[PATH_MAX + 80];
+    char *lineptr;
     char prefix[PATH_MAX] = ".";
     int fd;
 
@@ -2479,7 +2484,10 @@
 	    }
 	    break;
 	}
-	parse_ls_entry(prefix, line); /* sometimes changes prefix */
+	lineptr = line;
+	if (*lineptr == '/')
+	  lineptr++;
+	parse_ls_entry(prefix, lineptr); /* sometimes changes prefix */
     }
     parse_ls_entry(prefix, 0); /* finish up */
     
@@ -3085,8 +3093,12 @@
 	if (strcmp(".", pre) == 0) {
 	    sprintf(buffer, "%s", buf);
 	} else {
+	  if (pre[0] == '\0')
+	    sprintf(buffer, "%s", buf);
+	  else {
 	    sprintf(buffer, "%s/%s", pre, buf);
 	    fonly_pos = strlen(pre) + 1;
+	  }
 	}
 	if (S_ISLNK(p->perm)) {
 	    /* There doesn't seem to be a sane way to do this if the
diff -u fmirror-0.8.4/debian/changelog fmirror-0.8.4/debian/changelog
--- fmirror-0.8.4/debian/changelog
+++ fmirror-0.8.4/debian/changelog
@@ -1,3 +1,12 @@
+fmirror (2:0.8.4-13.0.1) unstable; urgency=low
+
+  * Added a special treatment for mirroring the / directory so that
+    fmirror (a) is able to guess the time difference and (b) does not try
+    to overwrite the local / directory instead of the specified local
+    mirror directory.  [fmirror.c]
+
+ -- Martin Schulze <[EMAIL PROTECTED]>  Tue, 10 Jul 2007 20:12:43 +0200
+
 fmirror (2:0.8.4-13) unstable; urgency=low
 
   * convert from debmake to debhelper

Reply via email to