From 300e008f98cc6c8e0540b051bac5390e3f248f4f Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 26 Jun 2014 09:36:50 -0700 Subject: [PATCH 1/2] 'zic -v' now warns about all '.'s in output file names. * zic.c (componentcheck, namecheck): Warn about all '.'s in the file name, not merely about "." and ".." file name components. * zic.8 (DESCRIPTION), NEWS: Document this. --- NEWS | 6 +++--- zic.8 | 7 +------ zic.c | 6 +----- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/NEWS b/NEWS index 5e5ba8e..80bad54 100644 --- a/NEWS +++ b/NEWS @@ -15,9 +15,9 @@ Unreleased, experimental changes Error diagnostics of 'zic' and 'yearistype' have been reworded so that they no longer use ASCII '-' as if it were a dash. - 'zic -v' now warns about output file names that do not follow POSIX rules, - or that contain a digit or a file name component of '.' or '..'. - (Thanks to Arthur David Olson for starting the ball rolling on this.) + 'zic -v' now warns about output file names that do not follow + POSIX rules, or that contain a digit or '.'. (Thanks to Arthur + David Olson for starting the ball rolling on this.) Some lint has been removed when using GCC_DEBUG_FLAGS with GCC 4.9.0. diff --git a/zic.8 b/zic.8 index 95dd038..e22e6cd 100644 --- a/zic.8 +++ b/zic.8 @@ -115,17 +115,12 @@ POSIX requires at least 3. .PP An output file name contains a byte that is not an ASCII letter, digit, .q "-" , -.q "." , .q "/" , or .q "_" ; or it contains a file name component that contains more than 14 bytes or that starts with -.q "-" -or is -.q "." -or -.q ".." . +.q "-" . .RE .TP .B \-s diff --git a/zic.c b/zic.c index 62c5fd5..ddf764c 100644 --- a/zic.c +++ b/zic.c @@ -630,10 +630,6 @@ componentcheck(char const *name, char const *component, if (0 < component_len && component[0] == '-') warning(_("file name '%s' component contains leading '-'"), name); - if (0 < component_len && component_len <= 2 - && component[0] == '.' && component_end[-1] == '.') - warning(_("file name '%s' contains '%.*s' component"), - name, (int) component_len, component); if (component_len_max < component_len) warning(_("file name '%s' contains overlength component" " '%.*s...'"), @@ -644,7 +640,7 @@ static void namecheck(const char *name) { register char const *cp; - static char const benign[] = ("-./_" + static char const benign[] = ("-/_" "abcdefghijklmnopqrstuvwxyz" "ABCDEFGHIJKLMNOPQRSTUVWXYZ"); register char const *component = name; -- 1.9.1