Compare commits

...

42 Commits

Author SHA1 Message Date
Jim Meyering
8596e37d97 . 1996-07-06 12:04:47 +00:00
Jim Meyering
5eb689ade0 Fix typo: top-srcdir -> top_srcdir. 1996-07-06 04:05:15 +00:00
Jim Meyering
195f8a213e [!STDC_HEADERS]: Declare free. From Marcus Daniels. 1996-07-06 03:17:09 +00:00
Jim Meyering
4d6b56a932 . 1996-07-06 03:02:44 +00:00
Jim Meyering
62a9c01c6d . 1996-07-06 03:00:44 +00:00
Jim Meyering
12dd329a29 Merge from gettext-0.10.23. 1996-07-06 02:59:12 +00:00
Jim Meyering
4a7000742c ($(PACKAGE).pot): Merge from gettext-0.10.23. 1996-07-06 02:58:59 +00:00
Jim Meyering
f41e1ff806 . 1996-07-05 03:58:06 +00:00
Jim Meyering
fa5ef15197 . 1996-07-05 03:40:39 +00:00
Jim Meyering
2b1f600cbd (usage): Remove space before newline in usage message. 1996-07-05 03:40:21 +00:00
Jim Meyering
0396e35b5a . 1996-07-05 03:39:21 +00:00
Jim Meyering
9824efff73 (usage): Remove space before newline in usage message. 1996-07-05 03:39:12 +00:00
Jim Meyering
7fbe57368e (usage): Remove space before newline in usage message. 1996-07-05 02:49:48 +00:00
Jim Meyering
21c0d8f1f0 (usage): Remove space before newline in usage message. 1996-07-05 02:29:10 +00:00
Jim Meyering
316490baea (usage): Remove space before newline in usage message. 1996-07-05 02:28:29 +00:00
Jim Meyering
bd77322580 . 1996-07-04 22:52:25 +00:00
Jim Meyering
09cf102456 . 1996-07-04 22:52:01 +00:00
Jim Meyering
f8514af7a6 (split_3): Add missing semicolon. From Jim Blandy. 1996-07-04 22:51:52 +00:00
Jim Meyering
6b4aadc588 . 1996-07-04 18:18:03 +00:00
Jim Meyering
e2e512d2d6 . 1996-07-04 18:14:46 +00:00
Jim Meyering
a7d29c59fa (main): Fix typo in last change. 1996-07-04 17:41:05 +00:00
Jim Meyering
b2e339dc25 . 1996-07-04 17:35:51 +00:00
Jim Meyering
e7342330e5 Make dir --version' and vdir --version' print their names, not `ls'.
Reported by Ulrich Drepper.
1996-07-04 17:35:47 +00:00
Jim Meyering
3f868304cf . 1996-07-04 14:53:28 +00:00
Jim Meyering
2926167cfa (md5_file): Replace obsolete comment with a description
of the function.
(md5_check): Don't use "s"-adding trick to form the plural of
`checksum.'  That doesn't work well with translation.
Suggestions from Ulrich Drepper.
1996-07-04 14:53:25 +00:00
Jim Meyering
84448306a4 . 1996-07-04 12:41:58 +00:00
Jim Meyering
b97436b18b (MIN_DIGEST_LINE_LENGTH): New macro.
[NEWLINE_REPLACEMENT_STRING*]: Remove macros.
(main): Output a leading backslash for a line describing a file
whose name contains a newline.  Then translate each NEWLINE byte
in the file name to the string, "\\n", and each backslash to "\\\\".
File names that don't contain NEWLINE aren't translated.
(split_3): Rewrite to handle file names with embedded newlines.
Miles Bader and Jim Blandy suggested this new encoding scheme.
1996-07-04 12:41:53 +00:00
Jim Meyering
db07df5448 . 1996-07-04 12:36:18 +00:00
Jim Meyering
4adeb81260 (split_3): Correct test for 35-byte line to accomodate
fact that leading blanks may be stripped.
1996-07-04 04:22:25 +00:00
Jim Meyering
9684207d04 . 1996-07-03 23:00:45 +00:00
Jim Meyering
b467d6d513 Include sys/types.h before system.h.
From Jim Blandy (jimb@cyclic.com).
1996-07-03 22:59:18 +00:00
Jim Meyering
36454232a5 . 1996-07-03 22:42:58 +00:00
Jim Meyering
ce85352146 [!MAXUID]: Define after inclusion of system.h to avoid
warning about redefinition on SunOS4, Solaris2.4 and SGI-irix5.3.
From Kaveh Ghazi.
1996-07-03 22:42:41 +00:00
Jim Meyering
7786c6e2cf . 1996-07-03 04:18:38 +00:00
Jim Meyering
4bd1ffa49a . 1996-07-03 04:05:07 +00:00
Jim Meyering
38762b8f78 (usage): Add omitted \n\ at the end of a line in the usage message. 1996-07-03 04:04:06 +00:00
Jim Meyering
7b2cea5ab2 [!EXIT_SUCCESS]: Define it.
[!EXIT_FAILURE]: Define it.
1996-07-03 04:00:36 +00:00
Jim Meyering
b0d3bfa316 . 1996-07-03 04:00:29 +00:00
Jim Meyering
1672bf6d27 (strndup): Include stdio.h and sys/types.h to
get definition of NULL and size_t on SunOS4.1.3.
1996-07-03 03:59:02 +00:00
Jim Meyering
8736952b0b . 1996-07-03 02:52:20 +00:00
Jim Meyering
bd1fc1c256 . 1996-07-02 04:55:06 +00:00
Jim Meyering
bb4d193ac7 [NEWLINE_REPLACEMENT_STRING]: Define.
(split_3): Translate NL bytes not to NUL, but to
NEWLINE_REPLACEMENT_STRING.
Suggested by Ulrich Drepper.
(main): Translate back to NL-containing filename.
1996-07-02 04:54:51 +00:00
17 changed files with 302 additions and 94 deletions

View File

@@ -175,35 +175,36 @@ following matrix shows the current state of GNU internationalization,
as of May 1996. The matrix shows, in regard of each package, for which
languages PO files have been submitted to translation coordination.
cs de en es fi fr ja ko no pl pt sl sv
.----------------------------------------.
bash | [] | 1
bison | | 0
clisp | [] [] [] | 3
cpio | [] | 1
diffutils | [] [] | 2
enscript | [] [] [] [] | 4
fileutils | [] [] [] [] | 4
findutils | [] [] | 2
flex | [] | 1
gettext | [] [] [] [] [] [] [] | 8
glibc | [] [] [] | 3
grep | [] [] [] [] | 4
hello | [] [] [] [] [] | 5
m4 | [] [] [] [] | 4
make | | 0
mkid | [] [] | 2
music | [] | 1
ptx | [] [] [] | 3
recode | [] [] [] [] [] | 5
sh-utils | [] [] | 2
sharutils | [] [] [] | 3
tar | [] [] [] [] [] [] [] | 7
textutils | [] [] [] | 3
wdiff | [] [] [] [] | 4
`----------------------------------------'
cs de en es fi fr ja ko no pl pt sl sv
1 16 1 3 1 21 1 6 3 1 3 6 9
cs de en es fi fr ja ko nl no pl pt sl sv
.-------------------------------------------.
bash | [] | 1
bison | [] | 1
clisp | [] [] [] | 3
cpio | [] | 1
diffutils | [] [] [] | 3
enscript | [] [] [] [] | 4
fileutils | [] [] [] [] | 4
findutils | [] [] | 2
flex | [] | 1
gcal | [] | 1
gettext | [] [] [] [] [] [] [] [] | 9
glibc | [] [] [] | 3
grep | [] [] [] [] [] [] | 6
hello | [] [] [] [] [] [] | 6
m4 | [] [] [] [] | 4
make | | 0
mkid | [] [] | 2
music | [] | 1
ptx | [] [] [] | 3
recode | [] [] [] [] [] | 5
sh-utils | [] [] | 2
sharutils | [] [] [] [] | 4
tar | [] [] [] [] [] [] [] | 7
textutils | [] [] [] [] | 4
wdiff | [] [] [] [] | 4
`-------------------------------------------'
cs de en es fi fr ja ko nl no pl pt sl sv
1 17 1 3 1 22 1 6 3 3 4 3 6 10 81
Some counters in the preceding matrix are higher than the number of
visible blocks let us expect. This is because a few extra PO files are

View File

@@ -21,6 +21,9 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
# include "config.h"
#endif
#include <stdio.h>
#include <sys/types.h>
#ifdef STDC_HEADERS
# include <string.h>
# include <stdlib.h>

View File

@@ -1,3 +1,43 @@
Fri Jul 5 22:16:13 1996 Jim Meyering <meyering@na-net.ornl.gov>
* src/dircolors.c [!STDC_HEADERS]: Declare free.
From Marcus Daniels.
Thu Jul 4 12:34:50 1996 Jim Meyering <meyering@na-net.ornl.gov>
* src/dd.c (usage): Remove space before newline in usage message.
* src/mknod.c (usage): Likewise.
* src/mv.c (usage): Likewise.
* src/Makefile.am (libexec_PROGRAMS): Regenerate using patched
automake-1.0 to work around rm -f bug on Solaris2.4.
Reported by Kaveh Ghazi.
* src/ls.c: Make `dir --version' and `vdir --version' print their
names, not `ls'.
Reported by Ulrich Drepper.
Wed Jul 3 17:41:15 1996 Jim Meyering <meyering@na-net.ornl.gov>
* src/dircolors.c: Include sys/types.h before system.h.
From Jim Blandy (jimb@cyclic.com).
* src/chgrp.c [!MAXUID]: Define after inclusion of system.h to avoid
warning about redefinition on SunOS4, Solaris2.4 and SGI-irix5.3.
From Kaveh Ghazi. Also, Santiago Vila Doncel reported that defining
MAXUID before including system.h caused a compilation failure on some
ConvexOS system.
Tue Jul 2 22:56:03 1996 Jim Meyering <meyering@na-net.ornl.gov>
* configure.in (VERSION): Bump to 3.12q.
* src/system.h [!EXIT_SUCCESS]: Define it.
[!EXIT_FAILURE]: Define it.
* lib/strndup.c (strndup): Include stdio.h and sys/types.h to
get definition of NULL and size_t on SunOS4.1.3.
Mon Jul 1 23:47:29 1996 Jim Meyering <meyering@na-net.ornl.gov>
* src/ln.c (do_link): Update messages to ease translation.
@@ -6,7 +46,7 @@ Mon Jul 1 23:47:29 1996 Jim Meyering <meyering@na-net.ornl.gov>
Sun Jun 30 16:41:45 1996 Jim Meyering <meyering@na-net.ornl.gov>
* src/install.c (usage): Fix typo, 3nd->3rd, in usage message.
From Santiago Vila <sanvila@unex.es>.
From Santiago Vila Doncel.
Sat Jun 29 00:33:31 1996 Jim Meyering <meyering@na-net.ornl.gov>

View File

@@ -1,3 +1,7 @@
Thu Jul 4 22:40:06 1996 Jim Meyering <meyering@na-net.ornl.gov>
* src/expr.c (docolon): Remove space before newline in usage message.
Sat Jun 29 18:58:20 1996 Jim Meyering <meyering@na-net.ornl.gov>
* configure.in (PACKAGE_VERSION): Add `GNU ' prefix so we see

View File

@@ -1,7 +1,59 @@
Fri Jul 5 21:55:58 1996 Jim Meyering <meyering@na-net.ornl.gov>
* po/Makefile.in.in ($(PACKAGE).pot): Merge from gettext-0.10.23.
* ABOUT-NLS: Likewise.
* intl/*: Likewise.
* aclocal.m4: Likewise.
Thu Jul 4 07:24:54 1996 Jim Meyering <meyering@na-net.ornl.gov>
* src/uniq.c (usage): Remove space before newline in usage message.
* src/md5sum.c (MIN_DIGEST_LINE_LENGTH): New macro.
[NEWLINE_REPLACEMENT_STRING*]: Remove macros.
(main): Output a leading backslash for a line describing a file
whose name contains a newline. Then translate each NEWLINE byte
in the file name to the string, "\\n", and each backslash to "\\\\".
File names that don't contain NEWLINE aren't translated.
(split_3): Rewrite to handle file names with embedded newlines.
Miles Bader and Jim Blandy suggested this new encoding scheme.
* src/md5sum.c (md5_file): Replace obsolete comment with a description
of the function.
(md5_check): Don't use "s"-adding trick to form the plural of
`checksum.' That doesn't work well with translation.
Suggestions from Ulrich Drepper.
(split_3): Add missing semicolon so it compiles. From Jim Blandy.
Wed Jul 3 23:21:09 1996 Jim Meyering <meyering@na-net.ornl.gov>
* src/md5sum.c (split_3): Correct test for 35-byte line to accomodate
fact that leading blanks may be stripped.
Tue Jul 2 21:51:40 1996 Jim Meyering <meyering@na-net.ornl.gov>
* configure.in (ALL_LINGUAS): Add dutch (nl).
Mon Jul 1 23:50:19 1996 Jim Meyering <meyering@na-net.ornl.gov>
* src/md5sum.c [NEWLINE_REPLACEMENT_STRING]: Define.
(split_3): Translate NL bytes not to NUL, but to
NEWLINE_REPLACEMENT_STRING.
Suggested by Ulrich Drepper.
(main): Translate back to NL-containing filename.
Sun Jun 30 22:42:17 1996 Jim Meyering <meyering@na-net.ornl.gov>
* src/md5sum.c (split_3): Take an additional parameter, S_LEN.
Adapt caller.
Map translated NEWLINE-containing filename back into the original
NEWLINE-containing name.
(md5_check): Translate NEWLINE bytes to NUL bytes in filename.
Sat Jun 29 18:59:07 1996 Jim Meyering <meyering@na-net.ornl.gov>
* configure.in (PACKAGE_VERSION): Add `GNU ' prefix so we see
it in the output of --version. Reported by RMS.
* configure.in (PACKAGE_VERSION): Add `GNU ' prefix so it
appears in the output of --version. Reported by RMS.
Wed Jun 26 21:35:10 1996 Jim Meyering <meyering@na-net.ornl.gov>

View File

@@ -1,3 +1,7 @@
Changes in release 1.19
* md5sum can verify digests of files with names containing newline characters
* update from gettext-0.10.20.
Changes in release 1.18
* when building sort, link with -lm on systems that use the replacement strtod
* update from gettext-0.10.17.

View File

@@ -35,6 +35,7 @@ subdir = po
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
MKINSTALLDIRS = @MKINSTALLDIRS@
CC = @CC@
GENCAT = @GENCAT@
@@ -120,8 +121,12 @@ stamp-cat-id: $(PACKAGE).pot
install: install-exec install-data
install-exec:
install-data: all
$(top_srcdir)/mkinstalldirs $(datadir)
catalogs='$(CATALOGS)'; \
if test -r $(MKINSTALLDIRS); then \
$(MKINSTALLDIRS) $(datadir); \
else \
$(top_srcdir)/mkinstalldirs $(datadir); \
fi
@catalogs='$(CATALOGS)'; \
for cat in $$catalogs; do \
case "$$cat" in \
*.gmo) destdir=$(gnulocaledir);; \
@@ -129,29 +134,43 @@ install-data: all
esac; \
lang=`echo $$cat | sed 's/$(CATOBJEXT)$$//'`; \
dir=$$destdir/$$lang/LC_MESSAGES; \
$(top_srcdir)/mkinstalldirs $$dir; \
if test -r $(MKINSTALLDIRS); then \
$(MKINSTALLDIRS) $$dir; \
else \
$(top_srcdir)/mkinstalldirs $$dir; \
fi; \
if test -r $$cat; then \
$(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \
else \
$(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
echo "installing $(srcdir)/$$cat as" \
"$$dir/$(PACKAGE)$(INSTOBJEXT)"; \
fi; \
if test -r $$cat.m; then \
$(INSTALL_DATA) $$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \
echo "installing $$cat.m as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
else \
if test -r $(srcdir)/$$cat.m ; then \
$(INSTALL_DATA) $(srcdir)/$$cat.m \
$$dir/$(PACKAGE)$(INSTOBJEXT).m; \
echo "installing $(srcdir)/$$cat as" \
"$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
else \
true; \
fi; \
fi; \
done
if test "$(PACKAGE)" = "gettext"; then \
$(top_srcdir)/mkinstalldirs $(gettextsrcdir); \
if test -r $(MKINSTALLDIRS); then \
$(MKINSTALLDIRS) $(gettextsrcdir); \
else \
$(top_srcdir)/mkinstalldirs $(gettextsrcdir); \
fi; \
cd $(srcdir) && \
$(INSTALL_DATA) Makefile.in.in $(gettextsrcdir)/Makefile.in.in; \
else \
true; \
: ; \
fi
# Define this as empty until I found a useful application.

View File

@@ -35,14 +35,15 @@
# define INT_MAX ((int) (UINT_MAX >> 1))
#endif
#ifndef MAXUID
# define MAXUID INT_MAX
#endif
#include "system.h"
#include "xstrtoul.h"
#include "error.h"
/* MAXUID may come from limits.h *or* sys/params.h (via system.h) above. */
#ifndef MAXUID
# define MAXUID INT_MAX
#endif
#ifndef _POSIX_VERSION
struct group *getgrnam ();
#endif

View File

@@ -1110,7 +1110,7 @@ by w for x2, by b for x512, by k for x1024. Each KEYWORD may be:\n\
ascii from EBCDIC to ASCII\n\
ebcdic from ASCII to EBCDIC\n\
ibm from ASCII to alternated EBCDIC\n\
block pad newline-terminated records with spaces to cbs-size \n\
block pad newline-terminated records with spaces to cbs-size\n\
unblock replace trailing spaces in cbs-size records with newline\n\
lcase change upper case to lower case\n\
ucase change lower case to upper case\n\

View File

@@ -20,6 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
# include <config.h>
#endif
#include <sys/types.h>
#include <ctype.h>
#include <getopt.h>
#include <stdio.h>
@@ -34,6 +35,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
#ifndef STDC_HEADERS
void free ();
#endif
char *xmalloc ();
char *basename ();
char *strndup();

View File

@@ -424,7 +424,7 @@ docolon (VALUE *sv, VALUE *pv)
if (pv->u.s[0] == '^')
{
error (0, 0, _("\
warning: unportable BRE: `%s': using `^' as the first character \n\
warning: unportable BRE: `%s': using `^' as the first character\n\
of the basic regular expression is not portable; it is being ignored"),
pv->u.s);
}

View File

@@ -661,7 +661,10 @@ main (int argc, char **argv)
if (show_version)
{
printf ("ls - %s\n", PACKAGE_VERSION);
printf ("%s - %s\n",
(ls_mode == LS_LS ? "ls"
: (ls_mode == LS_MULTI_COL ? "dir" : "vdir")),
PACKAGE_VERSION);
exit (0);
}
@@ -2738,7 +2741,7 @@ Sort entries alphabetically if none of -cftuSUX nor --sort.\n\
--version output version information and exit\n\
\n\
By default, color is not used to distinguish types of files. That is\n\
equivalent to using --color=none. Using the --color option without the
equivalent to using --color=none. Using the --color option without the\n\
optional WHEN argument is equivalent to using --color=always. With\n\
--color=auto, color codes are output only if standard output is connected\n\
to a terminal (tty).\n\

View File

@@ -59,6 +59,13 @@
# define TOLOWER(c) (ISUPPER (c) ? tolower (c) : (c))
#endif
/* The minimum length of a valid digest line in a file produced
by `md5sum FILE' and read by `md5sum --check'. This length does
not include any newline character at the end of a line. */
#define MIN_DIGEST_LINE_LENGTH (32 /* message digest length */ \
+ 2 /* blank and binary indicator */ \
+ 1 /* minimum filename length */ )
/* Nonzero if any of the files read were the standard input. */
static int have_read_stdin;
@@ -125,6 +132,7 @@ static int
split_3 (char *s, size_t s_len, char **u, int *binary, char **w)
{
size_t i;
int filename_has_newline = 0;
#define ISWHITE(c) ((c) == ' ' || (c) == '\t')
@@ -132,39 +140,82 @@ split_3 (char *s, size_t s_len, char **u, int *binary, char **w)
while (ISWHITE (s[i]))
++i;
/* The line has to be at least 35 characters long to contain correct
message digest information. */
if (s_len >= 32 + 2 + 1)
/* The line must have at least 35 (36 if the first is a backslash)
more characters to contain correct message digest information.
Ignore this line if it is too short. */
if (!(s_len - i >= MIN_DIGEST_LINE_LENGTH
|| (s[i] == '\\' && s_len - i >= 1 + MIN_DIGEST_LINE_LENGTH)))
return 1;
if (s[i] == '\\')
{
*u = &s[i];
/* The first field has to be the 32-character hexadecimal
representation of the message digest. If it is not followed
immediately by a white space it's an error. */
i += 32;
if (!ISWHITE (s[i]))
return 1;
s[i++] = '\0';
if (s[i] != ' ' && s[i] != '*')
return 1;
*binary = (s[i++] == '*');
/* All characters between the type indicator and end of line are
significant -- that includes leading and trailing white space. */
*w = &s[i];
/* Translate each NUL byte in the file name to a NEWLINE.
But not the last. */
for (/* empty */ ; i < s_len; ++i)
{
if (s[i] == '\0')
s[i] = '\n';
}
return 0;
++i;
filename_has_newline = 1;
}
return 1;
*u = &s[i];
/* The first field has to be the 32-character hexadecimal
representation of the message digest. If it is not followed
immediately by a white space it's an error. */
i += 32;
if (!ISWHITE (s[i]))
return 1;
s[i++] = '\0';
if (s[i] != ' ' && s[i] != '*')
return 1;
*binary = (s[i++] == '*');
/* All characters between the type indicator and end of line are
significant -- that includes leading and trailing white space. */
*w = &s[i];
if (filename_has_newline)
{
/* Translate each `\n' string in the file name to a NEWLINE,
and each `\\' string to a backslash. */
char *dst = &s[i];
while (i < s_len)
{
switch (s[i])
{
case '\\':
if (i == s_len - 1)
{
/* A valid line does not end with a backslash. */
return 1;
}
++i;
switch (s[i++])
{
case 'n':
*dst++ = '\n';
break;
case '\\':
*dst++ = '\\';
break;
default:
/* Only `\' or `n' may follow a backslash. */
return 1;
}
break;
case '\0':
/* The file name may not contain a NUL. */
return 1;
break;
default:
*dst++ = s[i++];
break;
}
}
*dst = '\0';
}
return 0;
}
static int
@@ -179,7 +230,9 @@ hex_digits (const char *s)
return 1;
}
/* FIXME: allow newline in filename by encoding it. */
/* An interface to md5_stream. Operate on FILENAME (it may be "-") and
put the result in *MD5_RESULT. Return non-zero upon failure, zero
to indicate success. */
static int
md5_file (const char *filename, int binary, unsigned char *md5_result)
@@ -277,8 +330,6 @@ md5_check (const char *checkfile_name, int binary)
if (line[line_length - 1] == '\n')
line[--line_length] = '\0';
/* FIXME: filename might contain NUL bytes. Map then to NEWLINEs
in split_3. */
err = split_3 (line, line_length, &md5num, &type_flag, &filename);
if (err || !hex_digits (md5num))
{
@@ -376,9 +427,10 @@ md5_check (const char *checkfile_name, int binary)
if (n_mismatched_checksums > 0)
{
error (0, 0,
_("WARNING: %d of %d computed checksum%s did NOT match"),
_("WARNING: %d of %d computed %s did NOT match"),
n_mismatched_checksums, n_computed_checkums,
(n_computed_checkums == 1 ? "" : "s"));
(n_computed_checkums == 1
? _("checksum") : _("checksums")));
}
}
}
@@ -510,7 +562,6 @@ main (int argc, char **argv)
for (; optind < argc; ++optind)
{
size_t i;
int fail;
char *file = argv[optind];
@@ -518,7 +569,12 @@ main (int argc, char **argv)
err |= fail;
if (!fail)
{
size_t filename_len;
size_t i;
/* Output a leading backslash if the file name contains
a newline. */
if (strchr (file, '\n'))
putchar ('\\');
for (i = 0; i < 16; ++i)
printf ("%02x", md5buffer[i]);
@@ -529,17 +585,25 @@ main (int argc, char **argv)
else
putchar (' ');
/* Translate NEWLINE bytes to NUL bytes.
But first record the length of the filename, FILE. */
filename_len = strlen (file);
/* Translate each NEWLINE byte to the string, "\\n",
and each backslash to "\\\\". */
for (i = 0; i < strlen (file); ++i)
{
if (file[i] == '\n')
file[i] = '\0';
switch (file[i])
{
case '\n':
fputs ("\\n", stdout);
break;
case '\\':
fputs ("\\\\", stdout);
break;
default:
putchar (file[i]);
break;
}
}
/* Use fwrite, not printf, to output FILE --
now it may contain NUL bytes. */
fwrite (file, sizeof (char), filename_len, stdout);
putchar ('\n');
}
}

View File

@@ -73,7 +73,7 @@ Create the special file NAME of the given TYPE.\n\
MAJOR MINOR are forbidden for TYPE p, mandatory otherwise. TYPE may be:\n\
\n\
b create a block (buffered) special file\n\
c, u create a character (unbuffered) special file \n\
c, u create a character (unbuffered) special file\n\
p create a FIFO\n"));
}
exit (status);

View File

@@ -398,7 +398,7 @@ version control may be set with VERSION_CONTROL, values are:\n\
\n\
t, numbered make numbered backups\n\
nil, existing numbered if numbered backups exist, simple otherwise\n\
never, simple always make simple backups \n"));
never, simple always make simple backups\n"));
}
exit (status);
}

View File

@@ -179,6 +179,18 @@ extern int errno;
char *getenv ();
#endif /* STDC_HEADERS */
/* The following test is to work around the gross typo in
systems like Sony NEWS-OS Release 4.0C, whereby EXIT_FAILURE
is defined to 0, not 1. */
#if !EXIT_FAILURE
# undef EXIT_FAILURE
# define EXIT_FAILURE 1
#endif
#ifndef EXIT_SUCCESS
# define EXIT_SUCCESS 0
#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#else

View File

@@ -132,7 +132,7 @@ standard input), writing to OUTPUT (or standard output).\n\
--version output version information and exit\n\
\n\
A field is a run of whitespace, than non-whitespace characters.\n\
Fields are skipped before chars. \n\
Fields are skipped before chars.\n\
"));
}
exit (status == 0 ? EXIT_SUCCESS : EXIT_FAILURE);