diff options
Diffstat (limited to 'stdlib')
-rw-r--r-- | stdlib/canonicalize.c | 21 | ||||
-rw-r--r-- | stdlib/test-canon.c | 5 |
2 files changed, 8 insertions, 18 deletions
diff --git a/stdlib/canonicalize.c b/stdlib/canonicalize.c index 2098d77df2..c859288147 100644 --- a/stdlib/canonicalize.c +++ b/stdlib/canonicalize.c @@ -1,5 +1,5 @@ /* Return the canonical absolute name of a given file. - Copyright (C) 1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc. + Copyright (C) 1996-2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -37,8 +37,8 @@ that cannot be resolved. If the path can be resolved, RESOLVED holds the same value as the value returned. */ -static char * -canonicalize (const char *name, char *resolved) +char * +__realpath (const char *name, char *resolved) { char *rpath, *dest, *extra_buf = NULL; const char *start, *end, *rpath_limit; @@ -204,25 +204,12 @@ error: free (rpath); return NULL; } - - -char * -__realpath (const char *name, char *resolved) -{ - if (resolved == NULL) - { - __set_errno (EINVAL); - return NULL; - } - - return canonicalize (name, resolved); -} weak_alias (__realpath, realpath) char * __canonicalize_file_name (const char *name) { - return canonicalize (name, NULL); + return __realpath (name, NULL); } weak_alias (__canonicalize_file_name, canonicalize_file_name) diff --git a/stdlib/test-canon.c b/stdlib/test-canon.c index e1beafd332..6b7375afd9 100644 --- a/stdlib/test-canon.c +++ b/stdlib/test-canon.c @@ -1,5 +1,5 @@ /* Test program for returning the canonical absolute name of a given file. - Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 2000, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by David Mosberger <davidm@azstarnet.com>. @@ -132,6 +132,8 @@ do_test (int argc, char ** argv) ++errors; } +#if 0 + /* This is now allowed. The test is invalid. */ errno = 0; if (realpath ("/", NULL) != NULL || errno != EINVAL) { @@ -139,6 +141,7 @@ do_test (int argc, char ** argv) " for realpath(...,NULL)\n", argv[0]); ++errors; } +#endif errno = 0; if (realpath ("", buf) != NULL || errno != ENOENT) |