From 7bf0e072bd772f3c5213deefbd2b5a4625e69ed9 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 9 May 2017 21:56:31 -0700 Subject: [PATCH 2/6] Remove unnecessary code for DOS file names in zic * Makefile: Adjust comment accordingly. * zic.c (mkdirs) [HAVE_DOS_FILE_NAMES]: Do not treat drive letters specially. Time zone names follow Unix convention, and drive letters have no special meaning. In other words, treat drive letters consistently with backslashes, which also do not have a special meaning here. If the -d argument of zic does not name an already-existing directory, it should use slashes to separate the already-existing ancestor prefix from the to-be-created subdirectories. --- Makefile | 1 - zic.c | 11 +++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 87fcfab..c5f30d9 100644 --- a/Makefile +++ b/Makefile @@ -110,7 +110,6 @@ LDLIBS= # -DBIG_BANG=-9999999LL if the Big Bang occurred at time -9999999 (see zic.c) # -DHAVE_DECL_ASCTIME_R=0 if does not declare asctime_r # -DHAVE_DIRECT_H if mkdir needs (MS-Windows) -# -DHAVE_DOS_FILE_NAMES if file names have drive specifiers etc. (MS-DOS) # -DHAVE_GETTEXT=1 if 'gettext' works (e.g., GNU/Linux, FreeBSD, Solaris) # -DHAVE_INCOMPATIBLE_CTIME_R=1 if your system's time.h declares # ctime_r and asctime_r incompatibly with the POSIX standard diff --git a/zic.c b/zic.c index 068fb43..74f0527 100644 --- a/zic.c +++ b/zic.c @@ -3133,11 +3133,14 @@ mkdirs(char const *argname, bool ancestors) cp = name = ecpyalloc(argname); + /* On MS-Windows systems, do not worry about drive letters or + backslashes, as this should suffice in practice. Time zone + names do not use drive letters and backslashes. If the -d + option of zic does not name an already-existing directory, + it can use slashes to separate the already-existing + ancestor prefix from the to-be-created subdirectories. */ + /* Do not mkdir a root directory, as it must exist. */ -#ifdef HAVE_DOS_FILE_NAMES - if (is_alpha(name[0]) && name[1] == ':') - cp += 2; -#endif while (*cp == '/') cp++; -- 2.7.4