From e0576a6aeae094c5fc5a95fae6bae82eabdce5bb Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 8 Aug 2004 16:53:10 +0000 Subject: [PATCH 1/1] Rename FILESYSTEM_PREFIX_LEN. --- lib/ChangeLog | 7 +++++++ lib/concatpath.c | 4 ++-- lib/pathname.h | 4 ++-- lib/progreloc.c | 6 +++--- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/lib/ChangeLog b/lib/ChangeLog index 605707fd2..124e9a842 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,10 @@ +2004-08-08 Bruno Haible + + * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from + FILESYSTEM_PREFIX_LEN. + * progreloc.c: Likewise. + * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN. + 2004-08-06 Paul Eggert Merge from tar. diff --git a/lib/concatpath.c b/lib/concatpath.c index 716d2f5d4..e614e3d2f 100644 --- a/lib/concatpath.c +++ b/lib/concatpath.c @@ -1,5 +1,5 @@ /* Construct a full pathname from a directory and a filename. - Copyright (C) 2001-2002 Free Software Foundation, Inc. + Copyright (C) 2001-2004 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 @@ -53,7 +53,7 @@ concatenated_pathname (const char *directory, const char *filename, { size_t directory_len = strlen (directory); int need_slash = - (directory_len > FILESYSTEM_PREFIX_LEN (directory) + (directory_len > FILE_SYSTEM_PREFIX_LEN (directory) && !ISSLASH (directory[directory_len - 1])); result = (char *) xmalloc (directory_len + need_slash + strlen (filename) diff --git a/lib/pathname.h b/lib/pathname.h index 1bce49bf7..418acae8e 100644 --- a/lib/pathname.h +++ b/lib/pathname.h @@ -38,13 +38,13 @@ extern "C" { # define IS_ABSOLUTE_PATH(P) (ISSLASH ((P)[0]) || HAS_DEVICE (P)) # define IS_PATH_WITH_DIR(P) \ (strchr (P, '/') != NULL || strchr (P, '\\') != NULL || HAS_DEVICE (P)) -# define FILESYSTEM_PREFIX_LEN(P) (HAS_DEVICE (P) ? 2 : 0) +# define FILE_SYSTEM_PREFIX_LEN(P) (HAS_DEVICE (P) ? 2 : 0) #else /* Unix */ # define ISSLASH(C) ((C) == '/') # define IS_ABSOLUTE_PATH(P) ISSLASH ((P)[0]) # define IS_PATH_WITH_DIR(P) (strchr (P, '/') != NULL) -# define FILESYSTEM_PREFIX_LEN(P) 0 +# define FILE_SYSTEM_PREFIX_LEN(P) 0 #endif /* Concatenate a directory pathname, a relative pathname and an optional diff --git a/lib/progreloc.c b/lib/progreloc.c index 0f87c1c92..f9bf5b2e7 100644 --- a/lib/progreloc.c +++ b/lib/progreloc.c @@ -1,5 +1,5 @@ /* Provide relocatable programs. - Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2003-2004 Free Software Foundation, Inc. Written by Bruno Haible , 2003. This program is free software; you can redistribute it and/or modify it @@ -67,12 +67,12 @@ && (P)[1] == ':') # define IS_PATH_WITH_DIR(P) \ (strchr (P, '/') != NULL || strchr (P, '\\') != NULL || HAS_DEVICE (P)) -# define FILESYSTEM_PREFIX_LEN(P) (HAS_DEVICE (P) ? 2 : 0) +# define FILE_SYSTEM_PREFIX_LEN(P) (HAS_DEVICE (P) ? 2 : 0) #else /* Unix */ # define ISSLASH(C) ((C) == '/') # define IS_PATH_WITH_DIR(P) (strchr (P, '/') != NULL) -# define FILESYSTEM_PREFIX_LEN(P) 0 +# define FILE_SYSTEM_PREFIX_LEN(P) 0 #endif #undef set_program_name -- 2.11.0