[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: yesno module consumes too much input
From: |
Eric Blake |
Subject: |
Re: yesno module consumes too much input |
Date: |
Sun, 19 Aug 2007 09:26:28 -0600 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070728 Thunderbird/2.0.0.6 Mnenhy/0.7.5.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Jim Meyering on 8/19/2007 12:47 AM:
> The complexity of the yesno-modifying approach seems too high,
> and not limited just to yesno, so I think the per-application
> one-line changes are better.
>
Here's the coreutils patch:
2007-08-19 Eric Blake <address@hidden>
Avoid consuming too much seekable input when yesno is used.
* bootstrap.conf (gnulib_modules): Grab closein.
* src/system.h (includes): Also include closein.h.
* src/mv.c (main): Use close_stdin, not close_stdout.
* src/cp.c (main): Likewise.
* src/ln.c (main): Likewise.
* src/rm.c (main): Likewise.
* src/install.c (main): Likewise.
* NEWS: Document the fix.
- --
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGyGEj84KuGfSFAYARAi71AKCkjA7SsSeLg//ApsIxlCuI4x5XMwCgtVrK
0tW79VrpoKUkS07UGOxzaYo=
=KTow
-----END PGP SIGNATURE-----
>From aa7c576c74ee06b8e99ba5173cf3ba52ec8ee372 Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Sun, 19 Aug 2007 09:21:00 -0600
Subject: [PATCH] Avoid consuming too much seekable input when yesno is
used.
* bootstrap.conf (gnulib_modules): Grab closein.
* src/system.h (includes): Also include closein.h.
* src/mv.c (main): Use close_stdin, not close_stdout.
* src/cp.c (main): Likewise.
* src/ln.c (main): Likewise.
* src/rm.c (main): Likewise.
* src/install.c (main): Likewise.
* NEWS: Document the fix.
Signed-off-by: Eric Blake <address@hidden>
---
ChangeLog | 12 ++++++++++++
NEWS | 3 +++
bootstrap.conf | 2 +-
lib/.cvsignore | 7 +++++++
lib/.gitignore | 7 +++++++
m4/.cvsignore | 4 ++++
m4/.gitignore | 4 ++++
po/ChangeLog | 6 +++++-
po/POTFILES.in | 1 +
src/cp.c | 2 +-
src/install.c | 2 +-
src/ln.c | 4 ++--
src/mv.c | 2 +-
src/rm.c | 2 +-
src/system.h | 1 +
15 files changed, 51 insertions(+), 8 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a477f3d..e8951b3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2007-08-19 Eric Blake <address@hidden>
+
+ Avoid consuming too much seekable input when yesno is used.
+ * bootstrap.conf (gnulib_modules): Grab closein.
+ * src/system.h (includes): Also include closein.h.
+ * src/mv.c (main): Use close_stdin, not close_stdout.
+ * src/cp.c (main): Likewise.
+ * src/ln.c (main): Likewise.
+ * src/rm.c (main): Likewise.
+ * src/install.c (main): Likewise.
+ * NEWS: Document the fix.
+
2007-08-18 Jim Meyering <address@hidden>
Use new "idcache.h" header.
diff --git a/NEWS b/NEWS
index 91149eb..9efd5d5 100644
--- a/NEWS
+++ b/NEWS
@@ -72,6 +72,9 @@ GNU coreutils NEWS -*-
outline -*-
"cp -i --update older newer" no longer prompts; same for mv
+ "cp -i" now detects read errors, and no longer consumes too much
+ seekable input; same for ln, install, mv, and rm.
+
cut now diagnoses a range starting with zero (e.g., -f 0-2) as invalid;
before, it would treat it as if it started with 1 (-f 1-2).
diff --git a/bootstrap.conf b/bootstrap.conf
index 58a3257..68896c7 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -40,7 +40,7 @@ gnulib_modules="
c-strcase c-strtod
c-strtold calloc canon-host canonicalize chown cloexec
config-h configmake
- closeout
+ closein closeout
crypto/md5 crypto/sha1
cycle-check
d-ino d-type diacrit dirfd dirname dup2
diff --git a/lib/.cvsignore b/lib/.cvsignore
index ae85b19..fd17849 100644
--- a/lib/.cvsignore
+++ b/lib/.cvsignore
@@ -42,6 +42,8 @@ cloexec.c
cloexec.h
close-stream.c
close-stream.h
+closein.c
+closein.h
closeout.c
closeout.h
concatpath.c
@@ -83,6 +85,7 @@ fcntl-safer.h
fcntl.h
fcntl_.h
fd-safer.c
+fflush.c
file-has-acl.c
file-type.c
file-type.h
@@ -103,6 +106,10 @@ fnmatch_loop.c
fopen-safer.c
fprintftime.c
fprintftime.h
+fpurge.c
+fpurge.h
+freading.c
+freading.h
free.c
fseeko.c
fstatat.c
diff --git a/lib/.gitignore b/lib/.gitignore
index b716aa8..f44081d 100644
--- a/lib/.gitignore
+++ b/lib/.gitignore
@@ -39,6 +39,8 @@ cloexec.c
cloexec.h
close-stream.c
close-stream.h
+closein.c
+closein.h
closeout.c
closeout.h
concatpath.c
@@ -78,6 +80,7 @@ fcntl-safer.h
fcntl.h
fcntl_.h
fd-safer.c
+fflush.c
file-has-acl.c
file-type.c
file-type.h
@@ -98,6 +101,10 @@ fnmatch_loop.c
fopen-safer.c
fprintftime.c
fprintftime.h
+fpurge.c
+fpurge.h
+freading.c
+freading.h
free.c
fseeko.c
fstatat.c
diff --git a/m4/.cvsignore b/m4/.cvsignore
index 88f1d88..648715b 100644
--- a/m4/.cvsignore
+++ b/m4/.cvsignore
@@ -19,6 +19,7 @@ chown.m4
clock_time.m4
cloexec.m4
close-stream.m4
+closein.m4
closeout.m4
codeset.m4
config-h.m4
@@ -41,6 +42,7 @@ extensions.m4
fchdir.m4
fcntl-safer.m4
fcntl_h.m4
+fflush.m4
file-type.m4
fileblocks.m4
filemode.m4
@@ -51,6 +53,8 @@ float_h.m4
fnmatch.m4
fpending.m4
fprintftime.m4
+fpurge.m4
+freading.m4
free.m4
fseeko.m4
fstypename.m4
diff --git a/m4/.gitignore b/m4/.gitignore
index 17ff100..1052407 100644
--- a/m4/.gitignore
+++ b/m4/.gitignore
@@ -18,6 +18,7 @@ chown.m4
clock_time.m4
cloexec.m4
close-stream.m4
+closein.m4
closeout.m4
codeset.m4
config-h.m4
@@ -40,6 +41,7 @@ extensions.m4
fchdir.m4
fcntl-safer.m4
fcntl_h.m4
+fflush.m4
file-type.m4
fileblocks.m4
filemode.m4
@@ -50,6 +52,8 @@ float_h.m4
fnmatch.m4
fpending.m4
fprintftime.m4
+fpurge.m4
+freading.m4
free.m4
fseeko.m4
fstypename.m4
diff --git a/po/ChangeLog b/po/ChangeLog
index 366ca74..247a76a 100644
--- a/po/ChangeLog
+++ b/po/ChangeLog
@@ -1,3 +1,7 @@
+2007-08-19 Eric Blake <address@hidden>
+
+ * POTFILES.in: Add lib/closein.c.
+
2007-08-08 Jim Meyering <address@hidden>
Adapt to gnulib's latest xstrtol change.
@@ -238,7 +242,7 @@
-----
- Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software
+ Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software
Foundation, Inc.
Copying and distribution of this file, with or without
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 61f6501..7f4d5c2 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -4,6 +4,7 @@
# These are nominally temporary...
lib/acl.c
lib/argmatch.c
+lib/closein.c
lib/closeout.c
lib/error.c
lib/euidaccess-stat.c
diff --git a/src/cp.c b/src/cp.c
index 2ea74cd..2549237 100644
--- a/src/cp.c
+++ b/src/cp.c
@@ -867,7 +867,7 @@ main (int argc, char **argv)
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
- atexit (close_stdout);
+ atexit (close_stdin);
selinux_enabled = (0 < is_selinux_enabled ());
cp_option_init (&x);
diff --git a/src/install.c b/src/install.c
index 28e2dd5..34f61ff 100644
--- a/src/install.c
+++ b/src/install.c
@@ -290,7 +290,7 @@ main (int argc, char **argv)
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
- atexit (close_stdout);
+ atexit (close_stdin);
cp_option_init (&x);
diff --git a/src/ln.c b/src/ln.c
index aec8b36..3ddcfdf 100644
--- a/src/ln.c
+++ b/src/ln.c
@@ -1,5 +1,5 @@
/* `ln' program to create links between files.
- Copyright (C) 1986, 1989-1991, 1995-2006 Free Software Foundation, Inc.
+ Copyright (C) 1986, 1989-1991, 1995-2007 Free Software Foundation, Inc.
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
@@ -398,7 +398,7 @@ main (int argc, char **argv)
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
- atexit (close_stdout);
+ atexit (close_stdin);
/* FIXME: consider not calling getenv for SIMPLE_BACKUP_SUFFIX unless
we'll actually use backup_suffix_string. */
diff --git a/src/mv.c b/src/mv.c
index fdf3283..1834f4c 100644
--- a/src/mv.c
+++ b/src/mv.c
@@ -357,7 +357,7 @@ main (int argc, char **argv)
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
- atexit (close_stdout);
+ atexit (close_stdin);
cp_option_init (&x);
diff --git a/src/rm.c b/src/rm.c
index 1749329..820646f 100644
--- a/src/rm.c
+++ b/src/rm.c
@@ -238,7 +238,7 @@ main (int argc, char **argv)
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
- atexit (close_stdout);
+ atexit (close_stdin);
rm_option_init (&x);
diff --git a/src/system.h b/src/system.h
index 3c7f49d..2c4bfd3 100644
--- a/src/system.h
+++ b/src/system.h
@@ -419,6 +419,7 @@ enum
#define VERSION_OPTION_DESCRIPTION \
_(" --version output version information and exit\n")
+#include "closein.h"
#include "closeout.h"
#include "version-etc.h"
--
1.5.2.2
- Re: yesno module consumes too much input,
Eric Blake <=