infinite loop in mdate-sh when TIME_STYLE is set

Vincent Lefevre vincent at vinc17.org
Thu May 28 14:41:35 CEST 2009


The doc/mdate-sh script in GMP 4.3.1 is outdated and affected by
the TIME_STYLE bug, which was fixed in 2005. See attached patch.

-- 
Vincent Lefèvre <vincent at vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)
-------------- next part --------------
2005-06-28  Stepan Kasal  <kasal at ucw.cz>

	* lib/mdate-sh: Avoid infinite loop with GNU ls when TIME_STYLE is set.
	Diagnosis by Vincent Lefevre, reported by James Youngman.

Index: lib/mdate-sh
===================================================================
RCS file: /cvs/automake/automake/lib/mdate-sh,v
retrieving revision 1.17
diff -u -r1.17 mdate-sh
--- lib/mdate-sh	14 May 2005 20:28:50 -0000	1.17
+++ lib/mdate-sh	28 Jun 2005 12:16:12 -0000
@@ -59,6 +59,12 @@
 LC_TIME=C
 export LC_TIME
 
+# GNU ls changes its time format in response to the TIME_STYLE variable, but
+# we cannot unset it since the V7 shell did not have an "unset" command.
+# The documentation says that the default is "posix-long-iso".
+#
+test "${TIME_STYLE+set}" = set && TIME_STYLE=posix-long-iso
+
 save_arg1="$1"
 
 # Find out how to get the extended ls output of a file or directory.


More information about the gmp-bugs mailing list