]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: fix spurious failure with leading spaces in file names
authorPádraig Brady <P@draigBrady.com>
Tue, 13 May 2014 08:54:29 +0000 (09:54 +0100)
committerPádraig Brady <P@draigBrady.com>
Tue, 13 May 2014 08:58:33 +0000 (09:58 +0100)
* tests/ls/stat-vs-dirent.sh: This test lists all parent directories,
and would spuriously fail if any of those had a file name with a
leading space as the first entry.  There is only ever a single space
between the right aligned inode number and the file name, so
process accordingly.

tests/ls/stat-vs-dirent.sh

index 6a87621eff3b58ddaece33ed440c0c5c1efef7a5..57c718a9875b51e10001804fe5ee2b2c29357858 100755 (executable)
@@ -30,7 +30,7 @@ while :; do
     d_ino=$(sed -n '1s/^ *\([0-9][0-9]*\) .*/\1/p;q' tmp)
 
     # Extract the name of the corresponding directory entry.
-    file=$(sed -n '1s/^ *[0-9][0-9]*  *//p;q' tmp)
+    file=$(sed -n '1s/^ *[0-9][0-9]* //p;q' tmp)
 
     # Get its inode number (stat.st_ino) via stat(1)'s call to lstat.
     st_ino=$(stat --format=%i "$t/$file")