+2004-08-08 Bruno Haible <bruno@clisp.org>
+
+ * relocatable.c (FILE_SYSTEM_PREFIX_LEN): Renamed from
+ FILESYSTEM_PREFIX_LEN.
+ (compute_curr_prefix): Update.
+
2004-05-14 Bruno Haible <bruno@clisp.org>
* vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
&& (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. */
/* 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;
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)
{
+2004-08-08 Bruno Haible <bruno@clisp.org>
+
+ * 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 <bruno@clisp.org>
* execute.c (environ): Declare if needed.
# 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
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;
{
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)
# 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
&& (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
&& (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. */
/* 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;
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)
{