X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=src%2Fnames.c;h=73b8741858e70335c0d99c211919143cf78b1cff;hb=b94eed6d03bd9f34f1d6336af8ea682804eb15b4;hp=936d7fd042b548fbad357db575eeac5acaf560ea;hpb=693134a4e7c6d41a73f2932e8cb4b93f77dac9f9;p=chaz%2Ftar diff --git a/src/names.c b/src/names.c index 936d7fd..73b8741 100644 --- a/src/names.c +++ b/src/names.c @@ -1,11 +1,11 @@ /* Various processing of names. Copyright (C) 1988, 1992, 1994, 1996, 1997, 1998, 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 - Free Software Foundation; either version 2, or (at your option) any later + Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, but @@ -572,8 +572,7 @@ all_names_found (struct tar_stat_info *p) len = strlen (p->file_name); for (cursor = namelist; cursor; cursor = cursor->next) { - if (cursor->matching_flags /* FIXME: check this */ - || (!WASFOUND (cursor) && cursor->name[0]) + if ((cursor->name[0] && !WASFOUND (cursor)) || (len >= cursor->length && ISSLASH (p->file_name[cursor->length]))) return false; } @@ -735,7 +734,7 @@ static void add_hierarchy_to_namelist (struct name *name, dev_t device) { char *file_name = name->name; - char *buffer = get_directory_contents (file_name, device); + const char *buffer = get_directory_contents (file_name, device); if (! buffer) name->dir_contents = "\0\0\0\0"; @@ -747,7 +746,7 @@ add_hierarchy_to_namelist (struct name *name, dev_t device) : NAME_FIELD_SIZE); char *namebuf = xmalloc (allocated_length + 1); /* FIXME: + 2 above? */ - char *string; + const char *string; size_t string_length; int change_dir = name->change_dir; @@ -1013,11 +1012,10 @@ contains_dot_dot (char const *name) if (p[0] == '.' && p[1] == '.' && (ISSLASH (p[2]) || !p[2])) return 1; - do + while (! ISSLASH (*p)) { if (! *p++) return 0; } - while (! ISSLASH (*p)); } }