[packages/openssl102: 270/432] - handle directories with spaces

adwol adwol at pld-linux.org
Sat Sep 29 01:24:16 CEST 2018


commit 4d0769bb8487a7a99cf636d32fdf09e16f173495
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Mon Nov 3 13:04:03 2008 +0000

    - handle directories with spaces
    
    Changed files:
        openssl-c_rehash.sh -> 1.2

 openssl-c_rehash.sh | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/openssl-c_rehash.sh b/openssl-c_rehash.sh
index 1069eea..2bddc5a 100644
--- a/openssl-c_rehash.sh
+++ b/openssl-c_rehash.sh
@@ -196,23 +196,27 @@ then
 fi
 
 # determine which directories to process
-# XXX: can't handle directories with spaces in names
-# XXX: ...use \n as dir separator and manipulate IFS?
+old_IFS=$IFS
 if [ ${#} -gt 0 ]
 then
+    IFS=':'
     DIRLIST=${*}
 elif [ -n "${SSL_CERT_DIR}" ]
 then
-    DIRLIST=$( echo ${SSL_CERT_DIR} | tr ':' ' ' )
+    DIRLIST=$SSL_CERT_DIR
 else
     DIRLIST=${DIR}/certs
 fi
 
+IFS=':'
+
 # process directories
 for CERT_DIR in ${DIRLIST}
 do
     if [ -d ${CERT_DIR} -a -w ${CERT_DIR} ]
     then
+        IFS=$old_IFS
         hash_dir ${CERT_DIR}
+        IFS=':'
     fi
 done
================================================================

---- gitweb:

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



More information about the pld-cvs-commit mailing list