projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Correct comments.
[gnulib.git]
/
lib
/
error.c
diff --git
a/lib/error.c
b/lib/error.c
index
16228c4
..
45698be
100644
(file)
--- a/
lib/error.c
+++ b/
lib/error.c
@@
-1,5
+1,5
@@
/* Error handler for noninteractive utilities
/* Error handler for noninteractive utilities
- Copyright (C) 1990-1998, 2000-200
2, 2003
Free Software Foundation, Inc.
+ Copyright (C) 1990-1998, 2000-200
3, 2004
Free Software Foundation, Inc.
This file is part of the GNU C Library.
This program is free software; you can redistribute it and/or modify
This file is part of the GNU C Library.
This program is free software; you can redistribute it and/or modify
@@
-14,7
+14,7
@@
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation,
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., 5
9 Temple Place - Suite 330, Boston, MA 02111-1307
, USA. */
+ Inc., 5
1 Franklin Street, Fifth Floor, Boston, MA 02110-1301
, USA. */
/* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */
/* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */
@@
-29,9
+29,7
@@
#include <stdlib.h>
#include <string.h>
#include <stdlib.h>
#include <string.h>
-#ifdef _LIBC
-# include <libintl.h>
-#else
+#if !_LIBC && ENABLE_NLS
# include "gettext.h"
#endif
# include "gettext.h"
#endif
@@
-40,7
+38,7
@@
# define mbsrtowcs __mbsrtowcs
#endif
# define mbsrtowcs __mbsrtowcs
#endif
-#if
!_LIBC
+#if
USE_UNLOCKED_IO
# include "unlocked-io.h"
#endif
# include "unlocked-io.h"
#endif
@@
-90,9
+88,9
@@
extern void __error_at_line (int status, int errnum, const char *file_name,
char *strerror_r ();
# endif
char *strerror_r ();
# endif
-#ifndef SIZE_MAX
-# define SIZE_MAX ((size_t) -1)
-#endif
+#
ifndef SIZE_MAX
+#
define SIZE_MAX ((size_t) -1)
+#
endif
/* The calling program should define program_name and set it to the
name of the executing program. */
/* The calling program should define program_name and set it to the
name of the executing program. */
@@
-106,7
+104,7
@@
extern char *program_name;
static void
print_errno_message (int errnum)
{
static void
print_errno_message (int errnum)
{
- char const *s;
+ char const *s
= NULL
;
#if defined HAVE_STRERROR_R || _LIBC
char errbuf[1024];
#if defined HAVE_STRERROR_R || _LIBC
char errbuf[1024];
@@
-115,15
+113,11
@@
print_errno_message (int errnum)
# else
if (__strerror_r (errnum, errbuf, sizeof errbuf) == 0)
s = errbuf;
# else
if (__strerror_r (errnum, errbuf, sizeof errbuf) == 0)
s = errbuf;
- else
- s = 0;
# endif
# endif
-#else
- s = strerror (errnum);
#endif
#if !_LIBC
#endif
#if !_LIBC
- if (! s)
+ if (! s
&& ! (s = strerror (errnum))
)
s = _("Unknown system error");
#endif
s = _("Unknown system error");
#endif
@@
-148,7
+142,7
@@
error_tail (int status, int errnum, const char *message, va_list args)
size_t len = strlen (message) + 1;
const wchar_t *wmessage = L"out of memory";
wchar_t *wbuf = (len < ALLOCA_LIMIT
size_t len = strlen (message) + 1;
const wchar_t *wmessage = L"out of memory";
wchar_t *wbuf = (len < ALLOCA_LIMIT
- ?
(void *)
alloca (len * sizeof *wbuf)
+ ? alloca (len * sizeof *wbuf)
: len <= SIZE_MAX / sizeof *wbuf
? malloc (len * sizeof *wbuf)
: NULL);
: len <= SIZE_MAX / sizeof *wbuf
? malloc (len * sizeof *wbuf)
: NULL);