X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fincremen.c;h=59215e5e2f393b8d459192facc8e7e725089a935;hb=ccdbafb2769c16a55565b387acea44a247001f6a;hp=6cd8efb8b2ae662ce2fe058d0b3ae6af34b6293b;hpb=37724f5e203c0aa40bb0d197c55aac87a1a272c1;p=chaz%2Ftar diff --git a/src/incremen.c b/src/incremen.c index 6cd8efb..59215e5 100644 --- a/src/incremen.c +++ b/src/incremen.c @@ -1,7 +1,7 @@ /* GNU dump extensions to tar. Copyright (C) 1988, 1992, 1993, 1994, 1996, 1997, 1999, 2000, 2001, - 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the @@ -378,7 +378,9 @@ dumpdir_size (const char *p) static int compare_dirnames (const void *first, const void *second) { - return strcmp (*(const char**)first, *(const char**)second); + char const *const *name1 = first; + char const *const *name2 = second; + return strcmp (*name1, *name2); } /* Compare dumpdir array from DIRECTORY with directory listing DIR and @@ -575,7 +577,7 @@ rename_handler (void *data, void *proc_data) { struct directory *prev, *p; - /* Detect eventual cycles and clear DIRF_RENAMED flag, so this entries + /* Detect eventual cycles and clear DIRF_RENAMED flag, so these entries are ignored when hit by this function next time. If the chain forms a cycle, prev points to the entry DIR is renamed from. In this case it still retains DIRF_RENAMED flag, which will be @@ -1434,6 +1436,7 @@ purge_directory (char const *directory_name) void list_dumpdir (char *buffer, size_t size) { + int state = 0; while (size) { switch (*buffer) @@ -1444,7 +1447,12 @@ list_dumpdir (char *buffer, size_t size) case 'R': case 'T': case 'X': - fprintf (stdlis, "%c ", *buffer); + fprintf (stdlis, "%c", *buffer); + if (state == 0) + { + fprintf (stdlis, " "); + state = 1; + } buffer++; size--; break; @@ -1453,6 +1461,7 @@ list_dumpdir (char *buffer, size_t size) fputc ('\n', stdlis); buffer++; size--; + state = 0; break; default: