bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* [PATCH] canonicalize-lgpl: merge proposed libc changes
@ 2020-12-24 22:49 Paul Eggert
  0 siblings, 0 replies; only message in thread
From: Paul Eggert @ 2020-12-24 22:49 UTC (permalink / raw)
  To: bug-gnulib; +Cc: Paul Eggert

This merges the changes proposed for glibc in:
https://sourceware.org/pipermail/libc-alpha/2020-December/121085.html
https://sourceware.org/pipermail/libc-alpha/2020-December/121086.html
* lib/canonicalize-lgpl.c: Include idx.h and filename.h
unconditionally.
(idx_t, IDX_MAX, FILE_SYSTEM_PREFIX_LEN, IS_ABSOLUTE_FILE_NAME)
(ISSLASH) [_LIBC]: Remove.
---
 ChangeLog               | 11 +++++++++++
 lib/canonicalize-lgpl.c |  9 ++-------
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 531c4166d..30be929b5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2020-12-24  Paul Eggert  <eggert@cs.ucla.edu>
+
+	canonicalize-lgpl: merge proposed libc changes
+	This merges the changes proposed for glibc in:
+	https://sourceware.org/pipermail/libc-alpha/2020-December/121085.html
+	https://sourceware.org/pipermail/libc-alpha/2020-December/121086.html
+	* lib/canonicalize-lgpl.c: Include idx.h and filename.h
+	unconditionally.
+	(idx_t, IDX_MAX, FILE_SYSTEM_PREFIX_LEN, IS_ABSOLUTE_FILE_NAME)
+	(ISSLASH) [_LIBC]: Remove.
+
 2020-12-24  Bruno Haible  <bruno@clisp.org>
 
 	posix_spawn-internal: Implement for native Windows.
diff --git a/lib/canonicalize-lgpl.c b/lib/canonicalize-lgpl.c
index d6dd18dcf..8c8f98abc 100644
--- a/lib/canonicalize-lgpl.c
+++ b/lib/canonicalize-lgpl.c
@@ -38,15 +38,12 @@
 #include <unistd.h>
 
 #include <eloop-threshold.h>
+#include <idx.h>
+#include <filename.h>
 #include <scratch_buffer.h>
 
 #ifdef _LIBC
 # include <shlib-compat.h>
-typedef ptrdiff_t idx_t;
-# define IDX_MAX PTRDIFF_MAX
-# define FILE_SYSTEM_PREFIX_LEN(name) 0
-# define IS_ABSOLUTE_FILE_NAME(name) ISSLASH (*(name))
-# define ISSLASH(c) ((c) == '/')
 # include <sysdep.h>
 # ifdef __ASSUME_FACCESSAT2
 #  define FACCESSAT_NEVER_EOVERFLOWS __ASSUME_FACCESSAT2
@@ -56,9 +53,7 @@ typedef ptrdiff_t idx_t;
 #else
 # define __canonicalize_file_name canonicalize_file_name
 # define __realpath realpath
-# include "idx.h"
 # include "pathmax.h"
-# include "filename.h"
 # define __faccessat faccessat
 # if defined _WIN32 && !defined __CYGWIN__
 #  define __getcwd _getcwd
-- 
2.27.0



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-12-24 22:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-24 22:49 [PATCH] canonicalize-lgpl: merge proposed libc changes Paul Eggert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).