diff options
author | Ralf Wildenhues <Ralf.Wildenhues@gmx.de> | 2007-03-29 23:26:48 +0000 |
---|---|---|
committer | Ralf Wildenhues <Ralf.Wildenhues@gmx.de> | 2007-03-29 23:26:48 +0000 |
commit | 1c594b6132ea84dfa00cc3d77ebd6567d95e94f3 (patch) | |
tree | 7a9759b912d437579c24fed29776c73735df4016 /lib/mdate-sh | |
parent | 574df3f633c9c8c7eb07c280c47ce959fc65fc5f (diff) | |
download | automake-1c594b6132ea84dfa00cc3d77ebd6567d95e94f3.tar.gz |
* lib/mdate-sh (ls_command): Use -n when available to avoid
problems with spaces in user/group names.
* tests/mdate5.test: New test.
* tests/Makefile.am: Adjust.
Diffstat (limited to 'lib/mdate-sh')
-rwxr-xr-x | lib/mdate-sh | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/mdate-sh b/lib/mdate-sh index cd916c0a3..83d27009d 100755 --- a/lib/mdate-sh +++ b/lib/mdate-sh @@ -1,9 +1,9 @@ #!/bin/sh # Get modification time of a file or directory and pretty-print it. -scriptversion=2005-06-29.22 +scriptversion=2007-03-30.02 -# Copyright (C) 1995, 1996, 1997, 2003, 2004, 2005 Free Software +# Copyright (C) 1995, 1996, 1997, 2003, 2004, 2005, 2007 Free Software # Foundation, Inc. # written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995 # @@ -75,6 +75,10 @@ if ls -L /dev/null 1>/dev/null 2>&1; then else ls_command='ls -l -d' fi +# Avoid user/group names that might have spaces, when possible. +if ls -n /dev/null 1>/dev/null 2>&1; then + ls_command="$ls_command -n" +fi # A `ls -l' line looks as follows on OS/2. # drwxrwx--- 0 Aug 11 2001 foo @@ -89,7 +93,7 @@ fi # words should be skipped to get the date. # On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below. -set x`ls -l -d /` +set x`$ls_command /` # Find which argument is the month. month= |