X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fbackupfile.c;h=32ffaeaa7b31473af888449615910547e2746c25;hb=718b0598a7e9f5e9bdf3efc7e91e69a78e465327;hp=449fb594197552c298ad93f26ee629908c43564b;hpb=267a39bafd249d7eb9c37df06dc6defcf41cb343;p=gnulib.git diff --git a/lib/backupfile.c b/lib/backupfile.c index 449fb5941..32ffaeaa7 100644 --- a/lib/backupfile.c +++ b/lib/backupfile.c @@ -1,7 +1,7 @@ /* backupfile.c -- make Emacs style backup file names Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005 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 @@ -21,7 +21,7 @@ /* Written by Paul Eggert and David MacKenzie. Some algorithms adapted from GNU Emacs. */ -#if HAVE_CONFIG_H +#ifdef HAVE_CONFIG_H # include #endif @@ -38,9 +38,7 @@ #include -#if HAVE_UNISTD_H -# include -#endif +#include #if HAVE_DIRENT_H # include @@ -334,13 +332,13 @@ find_backup_file_name (char const *file, enum backup_type backup_type) static char const * const backup_args[] = { - /* In a series of synonyms, present the most meaning full first, so + /* In a series of synonyms, present the most meaningful first, so that argmatch_valid be more readable. */ "none", "off", "simple", "never", "existing", "nil", "numbered", "t", - 0 + NULL }; static const enum backup_type backup_types[] = @@ -351,6 +349,10 @@ static const enum backup_type backup_types[] = numbered_backups, numbered_backups }; +/* Ensure that these two vectors have the same number of elements, + not counting the final NULL in the first one. */ +ARGMATCH_VERIFY (backup_args, backup_types); + /* Return the type of backup specified by VERSION. If VERSION is NULL or the empty string, return numbered_existing_backups. If VERSION is invalid or ambiguous, fail with a diagnostic appropriate