Compare commits

...

10 Commits

Author SHA1 Message Date
Jim Meyering
99b35637c4 . 1998-10-25 14:30:46 +00:00
Jim Meyering
09b8756e33 . 1998-10-25 14:30:15 +00:00
Jim Meyering
9c5d11d5c5 . 1998-10-25 14:28:04 +00:00
Jim Meyering
bf6c2a07af *** empty log message *** 1998-10-25 14:12:47 +00:00
Jim Meyering
c729fe037e (TESTS): Add new test `unreadable'. But comment
it out since we're so close to release and since the test compares the
text of diagnostics that are likely to vary between systems.
(TEST_ENVIRONMENT): Add required framework.
1998-10-25 14:08:38 +00:00
Jim Meyering
02cde32c0a *** empty log message *** 1998-10-25 14:03:09 +00:00
Jim Meyering
7741f87086 *** empty log message *** 1998-10-25 13:58:56 +00:00
Jim Meyering
9e630b86cb (remove_cwd_entries): Don't apply CLOSEDIR to a NULL
pointer. (provoke with `mkdir -m 0100 x; rm -rf x')
Upon CLOSEDIR failure, set `status' to RM_ERROR, not RM_OK.
(remove_dir): Return `status', rather than always RM_OK.
1998-10-25 13:58:50 +00:00
Jim Meyering
2e19f14a91 *** empty log message *** 1998-10-23 02:08:48 +00:00
Jim Meyering
65b1a6ec82 (usage): Add mention of --version and --help. 1998-10-23 02:08:35 +00:00
8 changed files with 100 additions and 10 deletions

View File

@@ -1,3 +1,21 @@
1998-10-25 Jim Meyering <meyering@ascend.com>
* README: Man pages will now be supported to the extent that
people send patches.
* Version 4.0-b6.
* tests/rm/unreadable: Two new tests.
* tests/rm/Makefile.am (TESTS): Add new test `unreadable'. But comment
it out since we're so close to release and since the test compares the
text of diagnostics that are likely to vary between systems.
(TEST_ENVIRONMENT): Add required framework.
* src/remove.c (remove_cwd_entries): Don't apply CLOSEDIR to a NULL
pointer. (provoke with `mkdir -m 0100 x; rm -rf x')
Upon CLOSEDIR failure, set `status' to RM_ERROR, not RM_OK.
(remove_dir): Return `status', rather than always RM_OK.
1998-10-18 Jim Meyering <meyering@ascend.com>
* Version 4.0-b5.

View File

@@ -1,4 +1,7 @@
Changes in release 4.0:
[4.0-b6]
* rm simply fails as it should (rather than segfaulting) for
`mkdir -m 0100 x; rm -rf x'
[4.0-b5]
* still *more* mktime.c portability tweaks
[4.0-b4]

View File

@@ -1,7 +1,12 @@
1998-10-04 Jim Meyering <meyering@ascend.com>
1998-10-22 Jim Meyering <meyering@ascend.com>
* Version 1.22g.
* src/fold.c (usage): Add mention of --version and --help.
Reported by Matej Vela <mvela@public.srce.hr>.
1998-10-04 Jim Meyering <meyering@ascend.com>
* lib/fnmatch.h: New file. (unused)
* lib/fnmatch.c: New file. (unused)
* lib/Makefile.am (noinst_HEADERS): Add fnmatch.h.

View File

@@ -74,6 +74,8 @@ standard output.\n\
-b, --bytes count bytes rather than columns\n\
-s, --spaces break at spaces\n\
-w, --width=WIDTH use WIDTH columns instead of 80\n\
--help display this help and exit\n\
--version output version information and exit\n\
"));
puts (_("\nReport bugs to <bug-textutils@gnu.org>."));
}

View File

@@ -575,12 +575,15 @@ remove_cwd_entries (const struct rm_options *x)
}
while (dirp == NULL);
if (CLOSEDIR (dirp))
if (dirp)
{
error (0, errno, "%s", full_filename ("."));
status = RM_OK;
if (CLOSEDIR (dirp))
{
error (0, errno, "%s", full_filename ("."));
status = RM_ERROR;
}
dirp = NULL;
}
dirp = NULL;
if (ht)
{
@@ -766,7 +769,7 @@ remove_dir (struct File_spec *fs, int need_save_cwd, const struct rm_options *x)
return RM_ERROR;
}
return RM_OK;
return status;
}
/* Remove the file or directory specified by FS after checking appropriate

View File

@@ -1,6 +1,13 @@
## Process this file with automake to produce Makefile.in -*-Makefile-*-.
AUTOMAKE_OPTIONS = 1.1 gnits
TESTS = r-1 r-2 r-3 i-1 ir-1 f-1 sunos-1 deep-1
TESTS = r-1 r-2 r-3 i-1 ir-1 f-1 sunos-1 deep-1 # unreadable
EXTRA_DIST = $(TESTS)
TESTS_ENVIRONMENT = RM=../../src/rm MKDIR=../../src/mkdir
TESTS_ENVIRONMENT = \
RM=../../src/rm \
MKDIR=../../src/mkdir \
top_srcdir=$(top_srcdir) \
srcdir=$(srcdir) \
PERL="@PERL@" \
PATH=../../src:$$PATH \
PROG=rm

View File

@@ -92,9 +92,16 @@ l = @l@
AUTOMAKE_OPTIONS = 1.1 gnits
TESTS = r-1 r-2 r-3 i-1 ir-1 f-1 sunos-1 deep-1
TESTS = r-1 r-2 r-3 i-1 ir-1 f-1 sunos-1 deep-1 # unreadable
EXTRA_DIST = $(TESTS)
TESTS_ENVIRONMENT = RM=../../src/rm MKDIR=../../src/mkdir
TESTS_ENVIRONMENT = \
RM=../../src/rm \
MKDIR=../../src/mkdir \
top_srcdir=$(top_srcdir) \
srcdir=$(srcdir) \
PERL="@PERL@" \
PATH=../../src:$$PATH \
PROG=rm
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../../config.h
CONFIG_CLEAN_FILES =

45
tests/rm/unreadable Executable file
View File

@@ -0,0 +1,45 @@
#!/bin/sh
: ${PERL=perl}
: ${srcdir=.}
case "$PERL" in
*'missing perl')
echo 1>&2 "$0: configure didn't find a usable version of Perl, so can't run this test"
exit 77
;;
esac
exec $PERL -w -I$srcdir/.. -MFetish -- - << \EOF
require 5.003;
use strict;
(my $program_name = $0) =~ s|.*/||;
# Turn off localisation of executable's ouput.
@ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;
my $d = "dir-$$";
my $mkdir = {PRE => sub {mkdir $d,0100 or die "$d: $!\n"}};
my $prog = $ENV{PROG} || die "$0: \$PROG not specified in environment\n";
my @Tests =
(
# test-name options input expected-output
#
['unreadable-1', '-rf', $d,
{EXIT => 1}, {ERR => "$prog: $d/.: Permission denied\n"}, $mkdir],
['unreadable-2', '-rf', $d,
{EXIT => 1},
{ERR => "$prog: $d/.: Permission denied\n" .
"$prog: cannot remove directory `$d': File exists\n"},
{PRE => sub { (mkdir $d,0700 and mkdir "$d/x",0700 and chmod 0100,$d)
or die "$d: $!\n"}} ],
);
my $save_temps = $ENV{SAVE_TEMPS};
my $verbose = $ENV{VERBOSE};
my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose);
exit $fail;
EOF