projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Adjust getdate's grammar to accept a slightly more regular language.
[gnulib.git]
/
lib
/
canonicalize-lgpl.c
diff --git
a/lib/canonicalize-lgpl.c
b/lib/canonicalize-lgpl.c
index
05ced11
..
e8d2b65
100644
(file)
--- a/
lib/canonicalize-lgpl.c
+++ b/
lib/canonicalize-lgpl.c
@@
-1,11
+1,11
@@
/* Return the canonical absolute name of a given file.
/* Return the canonical absolute name of a given file.
- Copyright (C) 1996-2003, 2005-200
6
Free Software Foundation, Inc.
+ Copyright (C) 1996-2003, 2005-200
7
Free Software Foundation, Inc.
This file is part of the GNU C Library.
This file is part of the GNU C Library.
- This program is free software
;
you can redistribute it and/or modify
+ 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
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version
2, or (at your option)
- any later version.
+ the Free Software Foundation; either version
3 of the License, or
+
(at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-13,8
+13,7
@@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <config.h>
@@
-66,7
+65,7
@@
# define __canonicalize_file_name canonicalize_file_name
# define __realpath rpl_realpath
# include "pathmax.h"
# define __canonicalize_file_name canonicalize_file_name
# define __realpath rpl_realpath
# include "pathmax.h"
-# include "
allocs
a.h"
+# include "
malloc
a.h"
# if HAVE_GETCWD
# ifdef VMS
/* We want the directory in Unix syntax, not in VMS syntax. */
# if HAVE_GETCWD
# ifdef VMS
/* We want the directory in Unix syntax, not in VMS syntax. */
@@
-135,7
+134,12
@@
__realpath (const char *name, char *resolved)
{
rpath = malloc (path_max);
if (rpath == NULL)
{
rpath = malloc (path_max);
if (rpath == NULL)
- return NULL;
+ {
+ /* It's easier to set errno to ENOMEM than to rely on the
+ 'malloc-posix' gnulib module. */
+ errno = ENOMEM;
+ return NULL;
+ }
}
else
rpath = resolved;
}
else
rpath = resolved;
@@
-209,7
+213,12
@@
__realpath (const char *name, char *resolved)
new_size += path_max;
new_rpath = (char *) realloc (rpath, new_size);
if (new_rpath == NULL)
new_size += path_max;
new_rpath = (char *) realloc (rpath, new_size);
if (new_rpath == NULL)
- goto error;
+ {
+ /* It's easier to set errno to ENOMEM than to rely on the
+ 'realloc-posix' gnulib module. */
+ errno = ENOMEM;
+ goto error;
+ }
rpath = new_rpath;
rpath_limit = rpath + new_size;
rpath = new_rpath;
rpath_limit = rpath + new_size;
@@
-244,7
+253,7
@@
__realpath (const char *name, char *resolved)
goto error;
}
goto error;
}
- buf =
allocs
a (path_max);
+ buf =
malloc
a (path_max);
if (!buf)
{
errno = ENOMEM;
if (!buf)
{
errno = ENOMEM;
@@
-255,7
+264,7
@@
__realpath (const char *name, char *resolved)
if (n < 0)
{
int saved_errno = errno;
if (n < 0)
{
int saved_errno = errno;
- free
s
a (buf);
+ freea (buf);
errno = saved_errno;
goto error;
}
errno = saved_errno;
goto error;
}
@@
-263,10
+272,10
@@
__realpath (const char *name, char *resolved)
if (!extra_buf)
{
if (!extra_buf)
{
- extra_buf =
allocs
a (path_max);
+ extra_buf =
malloc
a (path_max);
if (!extra_buf)
{
if (!extra_buf)
{
- free
s
a (buf);
+ freea (buf);
errno = ENOMEM;
goto error;
}
errno = ENOMEM;
goto error;
}
@@
-275,7
+284,7
@@
__realpath (const char *name, char *resolved)
len = strlen (end);
if ((long int) (n + len) >= path_max)
{
len = strlen (end);
if ((long int) (n + len) >= path_max)
{
- free
s
a (buf);
+ freea (buf);
__set_errno (ENAMETOOLONG);
goto error;
}
__set_errno (ENAMETOOLONG);
goto error;
}
@@
-299,7
+308,7
@@
__realpath (const char *name, char *resolved)
*dest = '\0';
if (extra_buf)
*dest = '\0';
if (extra_buf)
- free
s
a (extra_buf);
+ freea (extra_buf);
return resolved ? memcpy (resolved, rpath, dest - rpath + 1) : rpath;
return resolved ? memcpy (resolved, rpath, dest - rpath + 1) : rpath;
@@
-307,7
+316,7
@@
error:
{
int saved_errno = errno;
if (extra_buf)
{
int saved_errno = errno;
if (extra_buf)
- free
s
a (extra_buf);
+ freea (extra_buf);
if (resolved)
strcpy (resolved, rpath);
else
if (resolved)
strcpy (resolved, rpath);
else