[packages/openssl102: 306/432] - use 'ls -1 *' in place of 'for f in *' to avoid problems with spaces in file names

adwol adwol at pld-linux.org
Sat Sep 29 01:27:17 CEST 2018


commit 0dcbb8669ae811bfe678f7f837321e7197804eae
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Wed May 5 11:49:47 2010 +0000

    - use 'ls -1 *' in place of 'for f in *' to avoid problems with spaces in file names
    
    Changed files:
        openssl-c_rehash.sh -> 1.4

 openssl-c_rehash.sh | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)
---
diff --git a/openssl-c_rehash.sh b/openssl-c_rehash.sh
index 14f7e4c..068a060 100644
--- a/openssl-c_rehash.sh
+++ b/openssl-c_rehash.sh
@@ -131,14 +131,8 @@ hash_dir()
 
     cd ${1}
 
-    for FILE in *
+    ls -1 * 2>/dev/null | while read FILE
     do
-	# no files in directory at all, no point in continuing
-	if ! [ -f ${FILE} ]
-	then
-	    return 1
-	fi
-
         if echo ${FILE} | grep -q -E '^[[:xdigit:]]{8}\.r?[[:digit:]]+$' \
 	    	&& [ -h "${FILE}" ]
         then
@@ -146,14 +140,8 @@ hash_dir()
         fi
     done
 
-    for FILE in *.pem
+    ls -1 *.pem 2>/dev/null | while read FILE
     do
-	# no pem files so FILE gets set to the unexpanded *.pem
-	if ! [ -f ${FILE} ]
-	then
-	    break
-	fi
-
 	check_file ${FILE}
         local FILE_TYPE=${?}
 	local TYPE_STR=''
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/openssl102.git/commitdiff/9fc1b1b87b259e8a327c99835865e91a391efc9e



More information about the pld-cvs-commit mailing list