On Tue, Jun 07, 2005 at 09:57:26PM +0200, Vincent Lefevre wrote:

> I now remember that I also have TIME_STYLE="+%Y-%m-%d %H:%M:%S",
> which is used by ls (from the coreutils).

Some values of TIME_STYLE can cause an infinite loop in mdate-sh if
"ls" is from GNU coreutils.  This patch to mdate-sh fixes the
problem.  It also updates the FSF's address to the new one (see
http://savannah.gnu.org/forum/forum.php?forum_id=3766 for more
information).



2005-06-07  James Youngman  <[EMAIL PROTECTED]>

        * mdate-sh: (trivial change) Avoid infinite loop with GNU ls
          when TIME_STYLE is set.  Diagnosis by Vincent Lefevre.
          Also update the FSF's postal address. 

--- mdate-sh.OLD        2005-06-07 21:45:55.368832331 +0100
+++ mdate-sh    2005-06-07 21:51:59.553637951 +0100
@@ -1,9 +1,9 @@
 #!/bin/sh
 # Get modification time of a file or directory and pretty-print it.
 
-scriptversion=2004-12-08.12
+scriptversion=2005-06-07.21
 
-# Copyright (C) 1995, 1996, 1997, 2003, 2004 Free Software Foundation, Inc.
+# Copyright (C) 1995, 1996, 1997, 2003, 2004, 2005 Free Software Foundation, 
Inc.
 # written by Ulrich Drepper <[EMAIL PROTECTED]>, June 1995
 #
 # This program is free software; you can redistribute it and/or modify
@@ -18,7 +18,7 @@ scriptversion=2004-12-08.12
 #
 # 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -58,6 +58,10 @@ export LC_ALL
 LC_TIME=C
 export LC_TIME
 
+# GNU ls unserstands $TIME_STYLE.  Leaving it set at "+%Y-%m-%d %H:%M:%S" for 
+# example will cause this script to go into an infinite loop.
+unset TIME_STYLE
+
 save_arg1="$1"
 
 # Find out how to get the extended ls output of a file or directory.


_______________________________________________
Bug-findutils mailing list
Bug-findutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-findutils

Reply via email to