From: Bruno Haible Date: Sun, 8 Aug 2004 16:58:11 +0000 (+0000) Subject: Rename FILESYSTEM_PREFIX_LEN. X-Git-Tag: v0.14.2~249 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=deec1d2bfc96e8273ff94ace8f6011d87451628d;p=thirdparty%2Fgettext.git Rename FILESYSTEM_PREFIX_LEN. --- diff --git a/gettext-runtime/intl/ChangeLog b/gettext-runtime/intl/ChangeLog index 29ccf0b08..b6c3c03ee 100644 --- a/gettext-runtime/intl/ChangeLog +++ b/gettext-runtime/intl/ChangeLog @@ -1,3 +1,9 @@ +2004-08-08 Bruno Haible + + * relocatable.c (FILE_SYSTEM_PREFIX_LEN): Renamed from + FILESYSTEM_PREFIX_LEN. + (compute_curr_prefix): Update. + 2004-05-14 Bruno Haible * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision diff --git a/gettext-runtime/intl/relocatable.c b/gettext-runtime/intl/relocatable.c index c14b53f97..2683ace71 100644 --- a/gettext-runtime/intl/relocatable.c +++ b/gettext-runtime/intl/relocatable.c @@ -80,12 +80,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 /* Original installation prefix. */ @@ -189,7 +189,7 @@ compute_curr_prefix (const char *orig_installprefix, /* Determine the current installation directory. */ { - const char *p_base = curr_pathname + FILESYSTEM_PREFIX_LEN (curr_pathname); + const char *p_base = curr_pathname + FILE_SYSTEM_PREFIX_LEN (curr_pathname); const char *p = curr_pathname + strlen (curr_pathname); char *q; @@ -216,7 +216,7 @@ compute_curr_prefix (const char *orig_installprefix, const char *rp = rel_installdir + strlen (rel_installdir); const char *cp = curr_installdir + strlen (curr_installdir); const char *cp_base = - curr_installdir + FILESYSTEM_PREFIX_LEN (curr_installdir); + curr_installdir + FILE_SYSTEM_PREFIX_LEN (curr_installdir); while (rp > rel_installdir && cp > cp_base) { diff --git a/gettext-tools/lib/ChangeLog b/gettext-tools/lib/ChangeLog index 80b1b9bf7..2d21a87e2 100644 --- a/gettext-tools/lib/ChangeLog +++ b/gettext-tools/lib/ChangeLog @@ -1,3 +1,16 @@ +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. + * basename.c (FILE_SYSTEM_PREFIX_LEN): Renamed from + FILESYSTEM_PREFIX_LEN. + (basename): Update. + * relocatable.c (FILE_SYSTEM_PREFIX_LEN): Renamed from + FILESYSTEM_PREFIX_LEN. + (compute_curr_prefix): Update. + 2004-05-27 Bruno Haible * execute.c (environ): Declare if needed. diff --git a/gettext-tools/lib/basename.c b/gettext-tools/lib/basename.c index d99334738..8fd343827 100644 --- a/gettext-tools/lib/basename.c +++ b/gettext-tools/lib/basename.c @@ -36,12 +36,12 @@ # define HAS_DEVICE(P) \ ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \ && (P)[1] == ':') -# define FILESYSTEM_PREFIX_LEN(P) (HAS_DEVICE (P) ? 2 : 0) +# define FILE_SYSTEM_PREFIX_LEN(P) (HAS_DEVICE (P) ? 2 : 0) # define ISSLASH(C) ((C) == '/' || (C) == '\\') #endif -#ifndef FILESYSTEM_PREFIX_LEN -# define FILESYSTEM_PREFIX_LEN(Filename) 0 +#ifndef FILE_SYSTEM_PREFIX_LEN +# define FILE_SYSTEM_PREFIX_LEN(Filename) 0 #endif #ifndef ISSLASH @@ -63,7 +63,7 @@ char * basename (char const *name) { - char const *base = name += FILESYSTEM_PREFIX_LEN (name); + char const *base = name += FILE_SYSTEM_PREFIX_LEN (name); int all_slashes = 1; char const *p; diff --git a/gettext-tools/lib/concatpath.c b/gettext-tools/lib/concatpath.c index cce81d679..4ca3c1e43 100644 --- a/gettext-tools/lib/concatpath.c +++ b/gettext-tools/lib/concatpath.c @@ -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/gettext-tools/lib/pathname.h b/gettext-tools/lib/pathname.h index 1bce49bf7..418acae8e 100644 --- a/gettext-tools/lib/pathname.h +++ b/gettext-tools/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/gettext-tools/lib/progreloc.c b/gettext-tools/lib/progreloc.c index 21a2c810c..22f235006 100644 --- a/gettext-tools/lib/progreloc.c +++ b/gettext-tools/lib/progreloc.c @@ -68,12 +68,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 diff --git a/gettext-tools/lib/relocatable.c b/gettext-tools/lib/relocatable.c index c14b53f97..2683ace71 100644 --- a/gettext-tools/lib/relocatable.c +++ b/gettext-tools/lib/relocatable.c @@ -80,12 +80,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 /* Original installation prefix. */ @@ -189,7 +189,7 @@ compute_curr_prefix (const char *orig_installprefix, /* Determine the current installation directory. */ { - const char *p_base = curr_pathname + FILESYSTEM_PREFIX_LEN (curr_pathname); + const char *p_base = curr_pathname + FILE_SYSTEM_PREFIX_LEN (curr_pathname); const char *p = curr_pathname + strlen (curr_pathname); char *q; @@ -216,7 +216,7 @@ compute_curr_prefix (const char *orig_installprefix, const char *rp = rel_installdir + strlen (rel_installdir); const char *cp = curr_installdir + strlen (curr_installdir); const char *cp_base = - curr_installdir + FILESYSTEM_PREFIX_LEN (curr_installdir); + curr_installdir + FILE_SYSTEM_PREFIX_LEN (curr_installdir); while (rp > rel_installdir && cp > cp_base) {