summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <ebb9@byu.net>2009-10-30 06:48:14 -0600
committerEric Blake <ebb9@byu.net>2009-10-30 16:49:57 -0600
commit2c5cdd7ee599857815bb1bffd4953b46b16dbaf7 (patch)
tree6326062ccb2792f7a053f8f14863461f32c65e9d
parentb3602e85d8c625e8ffc08855b67c0ae11169a5f3 (diff)
downloadgnulib-2c5cdd7ee599857815bb1bffd4953b46b16dbaf7.tar.gz
exclude: make more robust
* lib/exclude.c (excluded_file_name): Abort on unexpected value, rather than masking a coding bug. Suggested by Bruno Haible. Signed-off-by: Eric Blake <ebb9@byu.net>
-rw-r--r--ChangeLog7
-rw-r--r--lib/exclude.c7
2 files changed, 11 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 561e6d4ac6..c146bcb53a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-10-30 Eric Blake <ebb9@byu.net>
+
+ exclude: make more robust
+ * lib/exclude.c (excluded_file_name): Abort on unexpected value,
+ rather than masking a coding bug.
+ Suggested by Bruno Haible.
+
2009-10-30 Jim Meyering <meyering@redhat.com>
perl scripts: remove #!/usr/bin/perl in favor of more portable...
diff --git a/lib/exclude.c b/lib/exclude.c
index 310c5abc24..d1b421d47e 100644
--- a/lib/exclude.c
+++ b/lib/exclude.c
@@ -412,9 +412,7 @@ excluded_file_name (struct exclude const *ex, char const *f)
excluded to included or vice versa. */
for (seg = ex->head; seg; seg = seg->next)
{
- /* Pacify gcc, so it doesn't issue a spurious
- "may be used uninitialized" warning. */
- bool rc = excluded;
+ bool rc;
switch (seg->type)
{
@@ -427,6 +425,9 @@ excluded_file_name (struct exclude const *ex, char const *f)
filename = xmalloc (strlen (f) + 1);
rc = excluded_file_name_p (seg, f, filename);
break;
+
+ default:
+ abort ();
}
if (rc != excluded)
{