mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2025-09-10 07:59:52 +02:00
Compare commits
74 Commits
FILEUTILS-
...
FILEUTILS-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c98ea50c21 | ||
|
|
78697777d7 | ||
|
|
83696460f0 | ||
|
|
bb8acb3640 | ||
|
|
4f29f1aeb2 | ||
|
|
36a4ba8ba3 | ||
|
|
aaafa60129 | ||
|
|
866e778210 | ||
|
|
805484b693 | ||
|
|
a10e992cbc | ||
|
|
44b11d6e67 | ||
|
|
108f50670d | ||
|
|
5885cbf0d2 | ||
|
|
640cdd2df4 | ||
|
|
a4d13e4b8f | ||
|
|
12beb90e58 | ||
|
|
4623f5dca3 | ||
|
|
b124be4eb1 | ||
|
|
c8feafc2a5 | ||
|
|
84b6d13a3c | ||
|
|
fb604ebdf4 | ||
|
|
778dd49f55 | ||
|
|
3e0fdc1a0b | ||
|
|
c4610f8bb6 | ||
|
|
824081f660 | ||
|
|
417bda1b99 | ||
|
|
dbb6fa88fd | ||
|
|
013f2fe433 | ||
|
|
de75384c2b | ||
|
|
9d691ba42f | ||
|
|
744ef2d96f | ||
|
|
0d978396d7 | ||
|
|
581db2ffeb | ||
|
|
0d1de84756 | ||
|
|
c4f9b63aea | ||
|
|
0472107417 | ||
|
|
e1de1d3a93 | ||
|
|
46b486ab5b | ||
|
|
68bd38e8a0 | ||
|
|
b5c86e8130 | ||
|
|
bd54740062 | ||
|
|
8596e37d97 | ||
|
|
5eb689ade0 | ||
|
|
195f8a213e | ||
|
|
4d6b56a932 | ||
|
|
62a9c01c6d | ||
|
|
12dd329a29 | ||
|
|
4a7000742c | ||
|
|
f41e1ff806 | ||
|
|
fa5ef15197 | ||
|
|
2b1f600cbd | ||
|
|
0396e35b5a | ||
|
|
9824efff73 | ||
|
|
7fbe57368e | ||
|
|
21c0d8f1f0 | ||
|
|
316490baea | ||
|
|
bd77322580 | ||
|
|
09cf102456 | ||
|
|
f8514af7a6 | ||
|
|
6b4aadc588 | ||
|
|
e2e512d2d6 | ||
|
|
a7d29c59fa | ||
|
|
b2e339dc25 | ||
|
|
e7342330e5 | ||
|
|
3f868304cf | ||
|
|
2926167cfa | ||
|
|
84448306a4 | ||
|
|
b97436b18b | ||
|
|
db07df5448 | ||
|
|
4adeb81260 | ||
|
|
9684207d04 | ||
|
|
b467d6d513 | ||
|
|
36454232a5 | ||
|
|
ce85352146 |
59
ABOUT-NLS
59
ABOUT-NLS
@@ -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
|
||||
|
||||
@@ -140,7 +140,7 @@ utilities.
|
||||
* Working context:: pwd stty printenv tty
|
||||
* User information:: id logname whoami groups users who
|
||||
* System context:: date uname hostname
|
||||
* Modified command invocation:: env nice nohup su
|
||||
* Modified command invocation:: chroot env nice nohup su
|
||||
* Delaying:: sleep
|
||||
* Numeric operations:: factor seq
|
||||
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
noinst_LIBRARIES = fu
|
||||
|
||||
EXTRA_DIST = alloca.c basename.c euidaccess.c fnmatch.c fsusage.c \
|
||||
ftruncate.c getdate.y getopt.c getopt1.c memcmp.c memcpy.c memset.c \
|
||||
ftruncate.c getdate.y getopt.c getopt1.c group-member.c \
|
||||
memcmp.c memcpy.c memset.c \
|
||||
mkdir.c mktime.c mountlist.c posixtm.y rename.c rmdir.c \
|
||||
stpcpy.c strcasecmp.c strdup.c strndup.c strstr.c strtol.c strtoul.c
|
||||
|
||||
@@ -10,7 +11,7 @@ INCLUDES = -I.. -I$(srcdir)
|
||||
|
||||
fu_SOURCES = getdate.c getline.c posixtm.c argmatch.c backupfile.c \
|
||||
dirname.c error.c fileblocks.c filemode.c \
|
||||
full-write.c getversion.c group-member.c idcache.c \
|
||||
full-write.c getversion.c idcache.c \
|
||||
isdir.c long-options.c makepath.c modechange.c obstack.c \
|
||||
safe-read.c save-cwd.c savedir.c stripslash.c userspec.c xgetcwd.c \
|
||||
xmalloc.c xstrdup.c xstrtol.c xstrtoul.c yesno.c
|
||||
|
||||
@@ -41,7 +41,8 @@ transform = @program_transform_name@
|
||||
noinst_LIBRARIES = fu
|
||||
|
||||
EXTRA_DIST = alloca.c basename.c euidaccess.c fnmatch.c fsusage.c \
|
||||
ftruncate.c getdate.y getopt.c getopt1.c memcmp.c memcpy.c memset.c \
|
||||
ftruncate.c getdate.y getopt.c getopt1.c group-member.c \
|
||||
memcmp.c memcpy.c memset.c \
|
||||
mkdir.c mktime.c mountlist.c posixtm.y rename.c rmdir.c \
|
||||
stpcpy.c strcasecmp.c strdup.c strndup.c strstr.c strtol.c strtoul.c
|
||||
|
||||
@@ -49,7 +50,7 @@ INCLUDES = -I.. -I$(srcdir)
|
||||
|
||||
fu_SOURCES = getdate.c getline.c posixtm.c argmatch.c backupfile.c \
|
||||
dirname.c error.c fileblocks.c filemode.c \
|
||||
full-write.c getversion.c group-member.c idcache.c \
|
||||
full-write.c getversion.c idcache.c \
|
||||
isdir.c long-options.c makepath.c modechange.c obstack.c \
|
||||
safe-read.c save-cwd.c savedir.c stripslash.c userspec.c xgetcwd.c \
|
||||
xmalloc.c xstrdup.c xstrtol.c xstrtoul.c yesno.c
|
||||
@@ -81,9 +82,9 @@ COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
|
||||
LINK = $(CC) $(LDFLAGS) -o $@
|
||||
fu_OBJECTS = getdate.o getline.o posixtm.o argmatch.o backupfile.o \
|
||||
dirname.o error.o fileblocks.o filemode.o full-write.o getversion.o \
|
||||
group-member.o idcache.o isdir.o long-options.o makepath.o modechange.o \
|
||||
obstack.o safe-read.o save-cwd.o savedir.o stripslash.o userspec.o \
|
||||
xgetcwd.o xmalloc.o xstrdup.o xstrtol.o xstrtoul.o yesno.o
|
||||
idcache.o isdir.o long-options.o makepath.o modechange.o obstack.o \
|
||||
safe-read.o save-cwd.o savedir.o stripslash.o userspec.o xgetcwd.o \
|
||||
xmalloc.o xstrdup.o xstrtol.o xstrtoul.o yesno.o
|
||||
EXTRA_fu_SOURCES =
|
||||
LIBFILES = libfu.a
|
||||
AR = ar
|
||||
@@ -110,16 +111,16 @@ $(srcdir)/.deps/fsusage.P $(srcdir)/.deps/ftruncate.P \
|
||||
$(srcdir)/.deps/full-write.P $(srcdir)/.deps/getdate.P \
|
||||
$(srcdir)/.deps/getline.P $(srcdir)/.deps/getopt.P \
|
||||
$(srcdir)/.deps/getopt1.P $(srcdir)/.deps/getversion.P \
|
||||
$(srcdir)/.deps/group-member.P $(srcdir)/.deps/idcache.P \
|
||||
$(srcdir)/.deps/isdir.P $(srcdir)/.deps/long-options.P \
|
||||
$(srcdir)/.deps/makepath.P $(srcdir)/.deps/modechange.P \
|
||||
$(srcdir)/.deps/mountlist.P $(srcdir)/.deps/obstack.P \
|
||||
$(srcdir)/.deps/posixtm.P $(srcdir)/.deps/safe-read.P \
|
||||
$(srcdir)/.deps/save-cwd.P $(srcdir)/.deps/savedir.P \
|
||||
$(srcdir)/.deps/stripslash.P $(srcdir)/.deps/userspec.P \
|
||||
$(srcdir)/.deps/xgetcwd.P $(srcdir)/.deps/xmalloc.P \
|
||||
$(srcdir)/.deps/xstrdup.P $(srcdir)/.deps/xstrtol.P \
|
||||
$(srcdir)/.deps/xstrtoul.P $(srcdir)/.deps/yesno.P
|
||||
$(srcdir)/.deps/idcache.P $(srcdir)/.deps/isdir.P \
|
||||
$(srcdir)/.deps/long-options.P $(srcdir)/.deps/makepath.P \
|
||||
$(srcdir)/.deps/modechange.P $(srcdir)/.deps/mountlist.P \
|
||||
$(srcdir)/.deps/obstack.P $(srcdir)/.deps/posixtm.P \
|
||||
$(srcdir)/.deps/safe-read.P $(srcdir)/.deps/save-cwd.P \
|
||||
$(srcdir)/.deps/savedir.P $(srcdir)/.deps/stripslash.P \
|
||||
$(srcdir)/.deps/userspec.P $(srcdir)/.deps/xgetcwd.P \
|
||||
$(srcdir)/.deps/xmalloc.P $(srcdir)/.deps/xstrdup.P \
|
||||
$(srcdir)/.deps/xstrtol.P $(srcdir)/.deps/xstrtoul.P \
|
||||
$(srcdir)/.deps/yesno.P
|
||||
SOURCES = $(fu_SOURCES)
|
||||
OBJECTS = $(fu_OBJECTS)
|
||||
|
||||
|
||||
111
lib/getopt.c
111
lib/getopt.c
@@ -3,7 +3,7 @@
|
||||
"Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu
|
||||
before changing it!
|
||||
|
||||
Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95
|
||||
Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 1996
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
@@ -18,7 +18,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, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
|
||||
Ditto for AIX 3.2 and <stdlib.h>. */
|
||||
@@ -53,12 +53,28 @@
|
||||
|
||||
/* This needs to come after some library #include
|
||||
to get __GNU_LIBRARY__ defined. */
|
||||
#ifdef __GNU_LIBRARY__
|
||||
#ifdef __GNU_LIBRARY__
|
||||
/* Don't include stdlib.h for non-GNU C libraries because some of them
|
||||
contain conflicting prototypes for getopt. */
|
||||
#include <stdlib.h>
|
||||
#if defined (_LIBC) || defined (HAVE_UNISTD_H)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#endif /* GNU C library. */
|
||||
|
||||
#ifdef VMS
|
||||
#include <unixlib.h>
|
||||
#if HAVE_STRING_H - 0
|
||||
#include <string.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
/* It's not Unix, really. See? Capital letters. */
|
||||
#include <windows.h>
|
||||
#define getpid() GetCurrentProcessId()
|
||||
#endif
|
||||
|
||||
#ifndef _
|
||||
/* This is for other GNU distributions with internationalized messages.
|
||||
When compiling libc, the _ macro is predefined. */
|
||||
@@ -166,7 +182,7 @@ static enum
|
||||
/* Value of POSIXLY_CORRECT environment variable. */
|
||||
static char *posixly_correct;
|
||||
|
||||
#ifdef __GNU_LIBRARY__
|
||||
#ifdef __GNU_LIBRARY__
|
||||
/* We want to avoid inclusion of string.h with non-GNU libraries
|
||||
because there are many ways it can cause trouble.
|
||||
On some systems, it contains special magic macros that don't work
|
||||
@@ -217,6 +233,12 @@ extern int strlen (const char *);
|
||||
static int first_nonopt;
|
||||
static int last_nonopt;
|
||||
|
||||
/* Bash 2.0 gives us an environment variable containing flags
|
||||
indicating ARGV elements that should not be considered arguments. */
|
||||
|
||||
static const char *nonoption_flags;
|
||||
static int nonoption_flags_len;
|
||||
|
||||
/* Exchange two adjacent subsequences of ARGV.
|
||||
One subsequence is elements [first_nonopt,last_nonopt)
|
||||
which contains all the non-options that have been skipped so far.
|
||||
@@ -226,6 +248,10 @@ static int last_nonopt;
|
||||
`first_nonopt' and `last_nonopt' are relocated so that they describe
|
||||
the new indices of the non-options in ARGV after they are moved. */
|
||||
|
||||
#if defined (__STDC__) && __STDC__
|
||||
static void exchange (char **);
|
||||
#endif
|
||||
|
||||
static void
|
||||
exchange (argv)
|
||||
char **argv;
|
||||
@@ -284,6 +310,9 @@ exchange (argv)
|
||||
|
||||
/* Initialize the internal data when the first call is made. */
|
||||
|
||||
#if defined (__STDC__) && __STDC__
|
||||
static const char *_getopt_initialize (const char *);
|
||||
#endif
|
||||
static const char *
|
||||
_getopt_initialize (optstring)
|
||||
const char *optstring;
|
||||
@@ -315,6 +344,21 @@ _getopt_initialize (optstring)
|
||||
else
|
||||
ordering = PERMUTE;
|
||||
|
||||
if (posixly_correct == NULL)
|
||||
{
|
||||
/* Bash 2.0 puts a special variable in the environment for each
|
||||
command it runs, specifying which ARGV elements are the results of
|
||||
file name wildcard expansion and therefore should not be
|
||||
considered as options. */
|
||||
char var[100];
|
||||
sprintf (var, "_%d_GNU_nonoption_argv_flags_", getpid ());
|
||||
nonoption_flags = getenv (var);
|
||||
if (nonoption_flags == NULL)
|
||||
nonoption_flags_len = 0;
|
||||
else
|
||||
nonoption_flags_len = strlen (nonoption_flags);
|
||||
}
|
||||
|
||||
return optstring;
|
||||
}
|
||||
|
||||
@@ -391,10 +435,24 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
optind = 1; /* Don't scan ARGV[0], the program name. */
|
||||
}
|
||||
|
||||
/* Test whether ARGV[optind] points to a non-option argument.
|
||||
Either it does not have option syntax, or there is an environment flag
|
||||
from the shell indicating it is not an option. */
|
||||
#define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \
|
||||
|| (optind < nonoption_flags_len \
|
||||
&& nonoption_flags[optind] == '1'))
|
||||
|
||||
if (nextchar == NULL || *nextchar == '\0')
|
||||
{
|
||||
/* Advance to the next ARGV-element. */
|
||||
|
||||
/* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been
|
||||
moved back by the user (who may also have changed the arguments). */
|
||||
if (last_nonopt > optind)
|
||||
last_nonopt = optind;
|
||||
if (first_nonopt > optind)
|
||||
first_nonopt = optind;
|
||||
|
||||
if (ordering == PERMUTE)
|
||||
{
|
||||
/* If we have just processed some options following some non-options,
|
||||
@@ -408,8 +466,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
/* Skip any additional non-options
|
||||
and extend the range of non-options previously skipped. */
|
||||
|
||||
while (optind < argc
|
||||
&& (argv[optind][0] != '-' || argv[optind][1] == '\0'))
|
||||
while (optind < argc && NONOPTION_P)
|
||||
optind++;
|
||||
last_nonopt = optind;
|
||||
}
|
||||
@@ -447,7 +504,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
/* If we have come to a non-option and did not permute it,
|
||||
either stop the scan or describe it to the caller and pass it by. */
|
||||
|
||||
if ((argv[optind][0] != '-' || argv[optind][1] == '\0'))
|
||||
if (NONOPTION_P)
|
||||
{
|
||||
if (ordering == REQUIRE_ORDER)
|
||||
return EOF;
|
||||
@@ -479,8 +536,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
|
||||
if (longopts != NULL
|
||||
&& (argv[optind][1] == '-'
|
||||
|| (long_only && (argv[optind][2]
|
||||
|| !my_index (optstring, argv[optind][1])))))
|
||||
|| (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1])))))
|
||||
{
|
||||
char *nameend;
|
||||
const struct option *p;
|
||||
@@ -493,8 +549,8 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
for (nameend = nextchar; *nameend && *nameend != '='; nameend++)
|
||||
/* Do nothing. */ ;
|
||||
|
||||
#ifdef lint
|
||||
indfound = 0; /* Avoid spurious compiler warning. */
|
||||
#ifdef lint /* Suppress `used before initialized' warning. */
|
||||
indfound = 0;
|
||||
#endif
|
||||
|
||||
/* Test all long options for either exact match
|
||||
@@ -528,6 +584,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
argv[0], argv[optind]);
|
||||
nextchar += strlen (nextchar);
|
||||
optind++;
|
||||
optopt = 0;
|
||||
return '?';
|
||||
}
|
||||
|
||||
@@ -544,18 +601,20 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
else
|
||||
{
|
||||
if (opterr)
|
||||
if (argv[optind - 1][1] == '-')
|
||||
/* --option */
|
||||
fprintf (stderr,
|
||||
_("%s: option `--%s' doesn't allow an argument\n"),
|
||||
argv[0], pfound->name);
|
||||
else
|
||||
/* +option or -option */
|
||||
fprintf (stderr,
|
||||
_("%s: option `%c%s' doesn't allow an argument\n"),
|
||||
argv[0], argv[optind - 1][0], pfound->name);
|
||||
if (argv[optind - 1][1] == '-')
|
||||
/* --option */
|
||||
fprintf (stderr,
|
||||
_("%s: option `--%s' doesn't allow an argument\n"),
|
||||
argv[0], pfound->name);
|
||||
else
|
||||
/* +option or -option */
|
||||
fprintf (stderr,
|
||||
_("%s: option `%c%s' doesn't allow an argument\n"),
|
||||
argv[0], argv[optind - 1][0], pfound->name);
|
||||
|
||||
nextchar += strlen (nextchar);
|
||||
|
||||
optopt = pfound->val;
|
||||
return '?';
|
||||
}
|
||||
}
|
||||
@@ -567,9 +626,10 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
{
|
||||
if (opterr)
|
||||
fprintf (stderr,
|
||||
_("%s: option `%s' requires an argument\n"),
|
||||
argv[0], argv[optind - 1]);
|
||||
_("%s: option `%s' requires an argument\n"),
|
||||
argv[0], argv[optind - 1]);
|
||||
nextchar += strlen (nextchar);
|
||||
optopt = pfound->val;
|
||||
return optstring[0] == ':' ? ':' : '?';
|
||||
}
|
||||
}
|
||||
@@ -604,6 +664,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
}
|
||||
nextchar = (char *) "";
|
||||
optind++;
|
||||
optopt = 0;
|
||||
return '?';
|
||||
}
|
||||
}
|
||||
@@ -663,8 +724,8 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
{
|
||||
/* 1003.2 specifies the format of this message. */
|
||||
fprintf (stderr,
|
||||
_("%s: option requires an argument -- %c\n"),
|
||||
argv[0], c);
|
||||
_("%s: option requires an argument -- %c\n"),
|
||||
argv[0], c);
|
||||
}
|
||||
optopt = c;
|
||||
if (optstring[0] == ':')
|
||||
|
||||
@@ -13,7 +13,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, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef _GETOPT_H
|
||||
#define _GETOPT_H 1
|
||||
|
||||
@@ -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, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
|
||||
@@ -1,3 +1,110 @@
|
||||
Thu Jul 11 21:50:48 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* Version 3.13.
|
||||
|
||||
* dircolors.1: New file -- but just a pointer to texinfo docs.
|
||||
* man/Makefile.am (man_MANS): Add dircolors.1.
|
||||
|
||||
* configure.in (VERSION): Bump to 3.13.
|
||||
|
||||
Wed Jul 10 22:57:29 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* aclocal.m4 (fp_PROG_CC_STDC): Include sys/stat.h in test program
|
||||
so that DYNIX/ptx V4.1.3 doesn't use `-Xc -D__EXTENSIONS__' -- with
|
||||
those options on that system, sys/stat.h gets compile errors.
|
||||
With help from Marcus Daniels.
|
||||
|
||||
* getopt.c: Update from gettext-0.10.23.
|
||||
* getopt1.c: Likewise.
|
||||
* getopt.h: Likewise.
|
||||
|
||||
Tue Jul 9 20:19:44 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* src/dircolors.c (usage): Improve --help message. From Karl Berry.
|
||||
(long_options): Add print-data-base and print-database.
|
||||
|
||||
* src/dircolors.c (dc_parse_stream): Don't give `unrecognized keyword'
|
||||
message unless we've processed a matching TERM directive. Reported
|
||||
by Karl Berry and François Pinard.
|
||||
|
||||
* src/install.c (UID_T_MAX): Use `(unsigned long)1' rather than
|
||||
`(uid_t)1' to avoid problems on systems where uid_t is signed.
|
||||
(GID_T_MAX): Likewise for gid_t.
|
||||
From Kjetil Torgrim Homme <kjetilho@ifi.uio.no>.
|
||||
|
||||
Sun Jul 7 22:40:08 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* src/ls.c: Change initial colors for `color_indicator' to match
|
||||
those currently in dircolors.hin. From Joshua Cowan.
|
||||
|
||||
* src/dircolors.hin: Recognize more filename extensions.
|
||||
From Joshua Cowan.
|
||||
|
||||
* src/Makefile.am (CLEANFILES): Add dcgen. From Joshua Cowan
|
||||
<jcowan@jcowan.reslife.okstate.edu>.
|
||||
|
||||
* src/Makefile.am (MAINTAINERCLEANFILES): Add dircolors.h.
|
||||
|
||||
* configure.in (AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL): Use it.
|
||||
* acconfig.h [GWINSZ_IN_SYS_IOCTL]: Add #undef.
|
||||
|
||||
* src/ls.c: Include termios.h.
|
||||
Guard inclusion of sys/ioctl.h with #ifdef GWINSZ_IN_SYS_IOCTL,
|
||||
rather than HAVE_SYS_IOCTL_H. Modelled after sh-utils' stty.c
|
||||
at suggestion from Chip Bennett <BennettC@j64.stratcom.af.mil>
|
||||
to make ls adjust its idea of screen width upon window resize
|
||||
on systems (SunOS, Solaris) where TIOCGWINSZ is defined in
|
||||
termios.h, and not sys/ioctl.h.
|
||||
|
||||
* aclocal.m4 (AM_SYS_POSIX_TERMIOS): New macro, derived from test
|
||||
in the configure.in from sh-utils.
|
||||
(AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL): Likewise.
|
||||
|
||||
Sat Jul 6 12:46:27 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* src/cp-aux.c (usage): Factor out backup-related text into
|
||||
separate string/printf statement so translators deal with only
|
||||
one corresponding string in .pot file.
|
||||
* src/install.c (usage): Likewise.
|
||||
* src/ln.c (usage): Likewise.
|
||||
* src/mv.c (usage): Likewise.
|
||||
Suggestion from Santiago Vila Doncel.
|
||||
|
||||
* configure.in (AC_REPLACE_FUNCS): Add group_member.
|
||||
(AC_LINK_FILES): Create link lib/group_member.c to lib/group-member.c.
|
||||
* lib/Makefile.am (fu_SOURCES): Remove group-member.c.
|
||||
(EXTRA_DIST): Add group-member.c here.
|
||||
|
||||
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.
|
||||
@@ -16,7 +123,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>
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
Changes in release 3.13:
|
||||
* ls properly determines window size on SunOS and Solaris systems
|
||||
* ls accepts new option --color[=WHEN] where WHEN is `always', `never',
|
||||
or `auto'. --color=never is the default. --color is equivalent
|
||||
to --color=always (documented only in --help message FIXME)
|
||||
* new program: dircolors (not yet documented FIXME)
|
||||
to --color=always.
|
||||
* new program: dircolors
|
||||
* ls allows 0 as argument to --tabsize (-T) option. Using --tabsize=0
|
||||
inhibits the use of TAB characters for separating columns.
|
||||
* you can create a backup of FILE with cp --force --backup FILE FILE. Before,
|
||||
@@ -18,8 +19,7 @@ Changes in release 3.13:
|
||||
--sync option to make df invoke sync before getting file system sizes.
|
||||
* internationalized diagnostic messages
|
||||
* mkdir accepts new option: --verbose
|
||||
* cp has been fixed so that the full file name it uses for the destination
|
||||
in `cp file D/' is `D/file', not `D//file'.
|
||||
* `cp file D/' uses the full file name `D/file' instead of `D//file'.
|
||||
* cp --backup a~ a fails instead of silently destroying the source file
|
||||
* df and du have new options --human-readable (-h) and --megabytes (-m).
|
||||
* install now honors --backup (-b), --suffix=SUFFIX (-S SUFFIX), and
|
||||
|
||||
@@ -1,3 +1,31 @@
|
||||
Wed Jul 10 22:57:29 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* aclocal.m4 (fp_PROG_CC_STDC): Include sys/stat.h in test program
|
||||
so that DYNIX/ptx V4.1.3 doesn't use `-Xc -D__EXTENSIONS__' -- with
|
||||
those options on that system, sys/stat.h gets compile errors.
|
||||
With help from Marcus Daniels.
|
||||
|
||||
* getopt.c: Update from gettext-0.10.23.
|
||||
* getopt1.c: Likewise.
|
||||
* getopt.h: Likewise.
|
||||
|
||||
Sun Jul 7 22:40:08 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* aclocal.m4 (AM_SYS_POSIX_TERMIOS): New macro, derived from test
|
||||
in configure.in.
|
||||
(AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL): Likewise.
|
||||
|
||||
Sat Jul 6 12:47:48 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* configure.in (AC_REPLACE_FUNCS): Add group_member.
|
||||
(AC_LINK_FILES): Create link lib/group_member.c to lib/group-member.c.
|
||||
* lib/Makefile.am (su_SOURCES): Remove group-member.c.
|
||||
(EXTRA_DIST): Add group-member.c here.
|
||||
|
||||
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
|
||||
|
||||
@@ -1,3 +1,62 @@
|
||||
Thu Jul 11 22:04:36 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* Version 1.19.
|
||||
|
||||
* configure.in (VERSION): Bump to 1.19.
|
||||
|
||||
Wed Jul 10 22:57:29 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* aclocal.m4 (fp_PROG_CC_STDC): Include sys/stat.h in test program
|
||||
so that DYNIX/ptx V4.1.3 doesn't use `-Xc -D__EXTENSIONS__' -- with
|
||||
those options on that system, sys/stat.h gets compile errors.
|
||||
With help from Marcus Daniels.
|
||||
|
||||
* getopt.c: Update from gettext-0.10.23.
|
||||
* getopt1.c: Likewise.
|
||||
* getopt.h: Likewise.
|
||||
|
||||
Tue Jul 9 18:07:23 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* src/fmt.c (MAXCOST): Use `(unsigned long)1' rather than `(COST)1'
|
||||
so the left operand of the << isn't signed.
|
||||
From Kjetil Torgrim Homme.
|
||||
|
||||
* po/Makefile.in.in (install-data): Don't install NLS files when
|
||||
they're not requested. From Ulrich Drepper. Reported by
|
||||
Kjetil Torgrim Homme <kjetilho@ifi.uio.no>.
|
||||
|
||||
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).
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -35,6 +35,7 @@ subdir = po
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
MKINSTALLDIRS = @MKINSTALLDIRS@
|
||||
|
||||
CC = @CC@
|
||||
GENCAT = @GENCAT@
|
||||
@@ -119,9 +120,15 @@ stamp-cat-id: $(PACKAGE).pot
|
||||
|
||||
install: install-exec install-data
|
||||
install-exec:
|
||||
install-data: all
|
||||
$(top_srcdir)/mkinstalldirs $(datadir)
|
||||
catalogs='$(CATALOGS)'; \
|
||||
install-data: install-data-@USE_NLS@
|
||||
install-data-no: all
|
||||
install-data-yes: all
|
||||
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 +136,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.
|
||||
|
||||
@@ -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
|
||||
|
||||
2
src/dd.c
2
src/dd.c
@@ -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\
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* FIXME: dircolors - parse a Slackware-style DIR_COLORS file.
|
||||
/* dircolors - output commands to set the LS_COLOR environment variable
|
||||
Copyright (C) 1994, 1995 H. Peter Anvin
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
|
||||
@@ -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();
|
||||
@@ -83,6 +88,8 @@ static struct option const long_options[] =
|
||||
{"csh", no_argument, NULL, 'c'},
|
||||
{"c-shell", no_argument, NULL, 'c'},
|
||||
{"help", no_argument, NULL, 'h'},
|
||||
{"print-data-base", no_argument, NULL, 'p'},
|
||||
{"print-database", no_argument, NULL, 'p'},
|
||||
{"version", no_argument, NULL, 'v'},
|
||||
};
|
||||
|
||||
@@ -98,12 +105,15 @@ usage (int status)
|
||||
{
|
||||
printf (_("Usage: %s [OPTION]... [FILE]\n"), program_name);
|
||||
printf (_("\
|
||||
Output commands to set the LS_COLOR environment variable.\n\
|
||||
\n\
|
||||
Determine format of output:\n\
|
||||
-b, --sh, --bourne-shell output Bourne shell code to set LS_COLOR\n\
|
||||
-c, --csh, --c-shell output C shell code to set LS_COLOR\n\
|
||||
-p, --print-data-base output defaults\n\
|
||||
-h, --help display this help and exit\n\
|
||||
--version output version information and exit\n\
|
||||
Determine format of output:\n\
|
||||
-p, --print-data-base output defaults\n\
|
||||
-b, --sh, --bourne-shell output Bourne shell code to set LS_COLOR\n\
|
||||
-c, --csh, --c-shell output C-shell code to set LS_COLOR\n"));
|
||||
"));
|
||||
}
|
||||
|
||||
exit (status == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
|
||||
@@ -119,7 +129,7 @@ xstrndup (const char *s, size_t n)
|
||||
}
|
||||
|
||||
/* If the SHELL environment variable is set to `csh' or `tcsh,'
|
||||
assume C-shell. Else Bourne shell. */
|
||||
assume C shell. Else Bourne shell. */
|
||||
|
||||
static enum Shell_syntax
|
||||
guess_shell_syntax (void)
|
||||
@@ -343,7 +353,7 @@ dc_parse_stream (FILE *fp, const char *filename)
|
||||
}
|
||||
}
|
||||
|
||||
if (unrecognized)
|
||||
if (unrecognized && (state == ST_TERMSURE || state == ST_TERMYES))
|
||||
{
|
||||
error (0, 0, _("%s:%lu: unrecognized keyword `%s'"),
|
||||
filename, (long unsigned) line_number, keywd);
|
||||
@@ -417,7 +427,7 @@ main (int argc, char **argv)
|
||||
syntax = SHELL_SYNTAX_BOURNE;
|
||||
break;
|
||||
|
||||
case 'c': /* C-shell syntax. */
|
||||
case 'c': /* C shell syntax. */
|
||||
syntax = SHELL_SYNTAX_C;
|
||||
break;
|
||||
|
||||
|
||||
@@ -57,9 +57,16 @@ EXEC 01;32
|
||||
.z 01;31
|
||||
.Z 01;31
|
||||
.gz 01;31
|
||||
.deb 01;31
|
||||
.jpg 01;35 # image formats
|
||||
.gif 01;35
|
||||
.bmp 01;35
|
||||
.ppm 01;35
|
||||
.tga 01;35
|
||||
.xbm 01;35
|
||||
.xpm 01;35
|
||||
.tif 01;35
|
||||
.mpg 01;37
|
||||
.avi 01;37
|
||||
.gl 01;37
|
||||
.dl 01;37
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
|
||||
typedef long COST;
|
||||
|
||||
#define MAXCOST (~(((COST) 1) << (8 * sizeof (COST) -1)))
|
||||
#define MAXCOST (~(((unsigned long) 1) << (8 * sizeof (COST) -1)))
|
||||
|
||||
#define SQR(n) ((n) * (n))
|
||||
#define EQUIV(n) SQR ((COST) (n))
|
||||
|
||||
@@ -102,11 +102,13 @@ int wait ();
|
||||
#define READ_SIZE (32 * 1024)
|
||||
|
||||
#ifndef UID_T_MAX
|
||||
# define UID_T_MAX ((uid_t)(~((uid_t)1 << (sizeof (uid_t) * BITSPERBYTE - 1))))
|
||||
# define UID_T_MAX ((uid_t)(~((unsigned long)1 << ((sizeof (uid_t) \
|
||||
* BITSPERBYTE - 1)))))
|
||||
#endif
|
||||
|
||||
#ifndef GID_T_MAX
|
||||
# define GID_T_MAX ((gid_t)(~((gid_t)1 << (sizeof (gid_t) * BITSPERBYTE - 1))))
|
||||
# define GID_T_MAX ((gid_t)(~((unsigned long)1 << ((sizeof (gid_t) \
|
||||
* BITSPERBYTE - 1)))))
|
||||
#endif
|
||||
|
||||
char *basename ();
|
||||
@@ -604,6 +606,8 @@ format, make all components of the given DIRECTORY(ies).\n\
|
||||
--help display this help and exit\n\
|
||||
--version output version information and exit\n\
|
||||
\n\
|
||||
"));
|
||||
printf (_("\
|
||||
The backup suffix is ~, unless set with SIMPLE_BACKUP_SUFFIX. The\n\
|
||||
version control may be set with VERSION_CONTROL, values are:\n\
|
||||
\n\
|
||||
|
||||
2
src/ln.c
2
src/ln.c
@@ -338,6 +338,8 @@ Makes hard links by default, symbolic links with -s.\n\
|
||||
--help display this help and exit\n\
|
||||
--version output version information and exit\n\
|
||||
\n\
|
||||
"));
|
||||
printf (_("\
|
||||
The backup suffix is ~, unless set with SIMPLE_BACKUP_SUFFIX. The\n\
|
||||
version control may be set with VERSION_CONTROL, values are:\n\
|
||||
\n\
|
||||
|
||||
44
src/ls.c
44
src/ls.c
@@ -43,7 +43,8 @@
|
||||
#include <config.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#if HAVE_SYS_IOCTL_H
|
||||
#include <termios.h>
|
||||
#ifdef GWINSZ_IN_SYS_IOCTL
|
||||
# include <sys/ioctl.h>
|
||||
#endif
|
||||
|
||||
@@ -129,24 +130,6 @@ struct bin_str
|
||||
char *string; /* Pointer to the same */
|
||||
};
|
||||
|
||||
struct bin_str color_indicator[] =
|
||||
{
|
||||
{ LEN_STR_PAIR ("\033[") }, /* lc: Left of color sequence */
|
||||
{ LEN_STR_PAIR ("m") }, /* rc: Right of color sequence */
|
||||
{ 0, NULL }, /* ec: End color (replaces lc+no+rc) */
|
||||
{ LEN_STR_PAIR ("0") }, /* no: Normal */
|
||||
{ LEN_STR_PAIR ("0") }, /* fi: File: default */
|
||||
{ LEN_STR_PAIR ("32") }, /* di: Directory: green */
|
||||
{ LEN_STR_PAIR ("36") }, /* ln: Symlink: cyan */
|
||||
{ LEN_STR_PAIR ("31") }, /* pi: Pipe: red */
|
||||
{ LEN_STR_PAIR ("33") }, /* so: Socket: yellow/brown */
|
||||
{ LEN_STR_PAIR ("44;37") }, /* bd: Block device: white on blue */
|
||||
{ LEN_STR_PAIR ("44;37") }, /* cd: Char device: white on blue */
|
||||
{ 0, NULL }, /* mi: Missing file: undefined */
|
||||
{ 0, NULL }, /* or: Orphanned symlink: undefined */
|
||||
{ LEN_STR_PAIR ("35") } /* ex: Executable: purple */
|
||||
};
|
||||
|
||||
#ifndef STDC_HEADERS
|
||||
char *ctime ();
|
||||
time_t time ();
|
||||
@@ -392,6 +375,24 @@ struct col_ext_type
|
||||
struct col_ext_type *next; /* Next in list */
|
||||
};
|
||||
|
||||
static struct bin_str color_indicator[] =
|
||||
{
|
||||
{ LEN_STR_PAIR ("\033[") }, /* lc: Left of color sequence */
|
||||
{ LEN_STR_PAIR ("m") }, /* rc: Right of color sequence */
|
||||
{ 0, NULL }, /* ec: End color (replaces lc+no+rc) */
|
||||
{ LEN_STR_PAIR ("0") }, /* no: Normal */
|
||||
{ LEN_STR_PAIR ("0") }, /* fi: File: default */
|
||||
{ LEN_STR_PAIR ("01;34") }, /* di: Directory: bright blue */
|
||||
{ LEN_STR_PAIR ("01;36") }, /* ln: Symlink: bright cyan */
|
||||
{ LEN_STR_PAIR ("33") }, /* pi: Pipe: yellow/brown */
|
||||
{ LEN_STR_PAIR ("01;35") }, /* so: Socket: bright magenta */
|
||||
{ LEN_STR_PAIR ("01;33") }, /* bd: Block device: bright yellow */
|
||||
{ LEN_STR_PAIR ("01;33") }, /* cd: Char device: bright yellow */
|
||||
{ 0, NULL }, /* mi: Missing file: undefined */
|
||||
{ 0, NULL }, /* or: Orphanned symlink: undefined */
|
||||
{ LEN_STR_PAIR ("01;32") } /* ex: Executable: bright green */
|
||||
};
|
||||
|
||||
/* FIXME: comment */
|
||||
struct col_ext_type *col_ext_list = NULL;
|
||||
|
||||
@@ -661,7 +662,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);
|
||||
}
|
||||
|
||||
|
||||
168
src/md5sum.c
168
src/md5sum.c
@@ -59,13 +59,12 @@
|
||||
# define TOLOWER(c) (ISUPPER (c) ? tolower (c) : (c))
|
||||
#endif
|
||||
|
||||
/* The string with which to replace NEWLINE characters in filenames.
|
||||
This is required to make it so md5sum --check can parse the output
|
||||
of `md5sum FILENAME' for FILENAME contain NL characters. */
|
||||
#define NEWLINE_REPLACEMENT_STRING "<\"NL'\\>"
|
||||
|
||||
#define NEWLINE_REPLACEMENT_STRING_LENGTH \
|
||||
(sizeof (NEWLINE_REPLACEMENT_STRING) - 1)
|
||||
/* 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;
|
||||
@@ -133,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')
|
||||
|
||||
@@ -140,45 +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] == '\\')
|
||||
{
|
||||
char *p;
|
||||
*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 NEWLINE_REPLACEMENT_STRING in the file name
|
||||
to a NEWLINE. */
|
||||
p = &s[i];
|
||||
while ((p = strstr (p, NEWLINE_REPLACEMENT_STRING)))
|
||||
{
|
||||
size_t len;
|
||||
|
||||
*p++ = '\n';
|
||||
len = s_len - (p - s) - (NEWLINE_REPLACEMENT_STRING_LENGTH - 1) + 1;
|
||||
memmove (p, p + NEWLINE_REPLACEMENT_STRING_LENGTH - 1, len);
|
||||
s_len -= NEWLINE_REPLACEMENT_STRING_LENGTH - 1;
|
||||
}
|
||||
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
|
||||
@@ -193,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)
|
||||
@@ -388,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")));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -522,7 +562,6 @@ main (int argc, char **argv)
|
||||
|
||||
for (; optind < argc; ++optind)
|
||||
{
|
||||
size_t i;
|
||||
int fail;
|
||||
char *file = argv[optind];
|
||||
|
||||
@@ -530,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]);
|
||||
@@ -541,16 +585,24 @@ main (int argc, char **argv)
|
||||
else
|
||||
putchar (' ');
|
||||
|
||||
/* Translate each NEWLINE byte to the string,
|
||||
NEWLINE_REPLACEMENT_STRING. But first record
|
||||
the length of the filename, FILE. */
|
||||
filename_len = strlen (file);
|
||||
for (i = 0; i < filename_len; ++i)
|
||||
/* Translate each NEWLINE byte to the string, "\\n",
|
||||
and each backslash to "\\\\". */
|
||||
for (i = 0; i < strlen (file); ++i)
|
||||
{
|
||||
if (file[i] == '\n')
|
||||
fputs (NEWLINE_REPLACEMENT_STRING, stdout);
|
||||
else
|
||||
putchar (file[i]);
|
||||
switch (file[i])
|
||||
{
|
||||
case '\n':
|
||||
fputs ("\\n", stdout);
|
||||
break;
|
||||
|
||||
case '\\':
|
||||
fputs ("\\\\", stdout);
|
||||
break;
|
||||
|
||||
default:
|
||||
putchar (file[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
putchar ('\n');
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
4
src/mv.c
4
src/mv.c
@@ -393,12 +393,14 @@ Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.\n\
|
||||
--help display this help and exit\n\
|
||||
--version output version information and exit\n\
|
||||
\n\
|
||||
"));
|
||||
printf (_("\
|
||||
The backup suffix is ~, unless set with SIMPLE_BACKUP_SUFFIX. The\n\
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user