Re: Call for development freeze



Leonard den Ottolander wrote:
Roland is double checking the shell scripts in extfs for quoting errors.

Here are some more issues regarding the VFS shell scripts.

Roland
Index: vfs/extfs/audio.in
===================================================================
RCS file: /cvsroot/mc/mc/vfs/extfs/audio.in,v
retrieving revision 1.8
diff -u -p -u -p -r1.8 audio.in
--- vfs/extfs/audio.in	18 Oct 2004 02:20:09 -0000	1.8
+++ vfs/extfs/audio.in	10 Nov 2004 06:43:53 -0000
@@ -18,7 +18,7 @@ audiofs_list()
     echo "-r--r--r-- 1 0 0 0 $DATE CDDB"
     cdparanoia -Q -d "$1" 2>&1 | grep '^[ 0-9][ 0-9][ 0-9]\.' | while read A B C
     do
-	A=`echo $A | sed -e 's/\.//' -e 's/^\(.\)$/0\1/'`
+	A=`echo "$A" | sed -e 's/\.//' -e 's/^\(.\)$/0\1/'`
 	SIZE=`expr 44 + $B \* 2352`
 	echo "-r--r--r-- 1 0 0 $SIZE $DATE track-${A}.wav"
     done
@@ -26,7 +26,7 @@ audiofs_list()
 
 audiofs_copyout()
 {
-    if [ "$2" == "CDDB" ]; then
+    if [ x"$2" = x"CDDB" ]; then
         DISCID=`cd-discid "$1" | tr " " "+"`
 	if [ -z "$DISCID" ]; then
 	    exit 1
Index: vfs/extfs/trpm
===================================================================
RCS file: /cvsroot/mc/mc/vfs/extfs/trpm,v
retrieving revision 1.6
diff -u -p -u -p -r1.6 trpm
--- vfs/extfs/trpm	27 Oct 2004 14:44:31 -0000	1.6
+++ vfs/extfs/trpm	10 Nov 2004 06:43:53 -0000
@@ -166,7 +166,7 @@ mcrpmfs_run ()
     esac
 }
 
-name=`sed 's/.*\///;s/\.trpm$//' "$2"`
+name=`echo "$2" | sed 's/.*\///;s/\.trpm$//'`
 
 case "$1" in
   list) mcrpmfs_list "$name"; exit 0;;
Index: vfs/extfs/uar.in
===================================================================
RCS file: /cvsroot/mc/mc/vfs/extfs/uar.in,v
retrieving revision 1.8
diff -u -p -u -p -r1.8 uar.in
--- vfs/extfs/uar.in	17 Oct 2004 22:09:18 -0000	1.8
+++ vfs/extfs/uar.in	10 Nov 2004 06:43:53 -0000
@@ -22,7 +22,7 @@ mcarfs_copyout ()
 
 mcarfs_copyin ()
 {
-    TMPDIR=`mktemp -d ${MC_TMPDIR:-/tmp}/mctmpdir-uar.XXXXXX` || exit 1
+    TMPDIR=`mktemp -d "${MC_TMPDIR:-/tmp}/mctmpdir-uar.XXXXXX"` || exit 1
     name=`basename "$2"`
     (cd "$TMPDIR" && cp -fp "$3" "$name" && $XAR r "$1" "$name")
     rm -rf "$TMPDIR"
Index: vfs/extfs/uha.in
===================================================================
RCS file: /cvsroot/mc/mc/vfs/extfs/uha.in,v
retrieving revision 1.5
diff -u -p -u -p -r1.5 uha.in
--- vfs/extfs/uha.in	17 Aug 2004 08:24:59 -0000	1.5
+++ vfs/extfs/uha.in	10 Nov 2004 06:43:53 -0000
@@ -31,14 +31,14 @@ mchafs_list ()
 
 mchafs_copyout ()
 {
-    TMPDIR=`mktemp -d ${MC_TMPDIR:-/tmp}/mctmpdir-uha.XXXXXX` || exit 1
-    cd $TMPDIR
+    TMPDIR=`mktemp -d "${MC_TMPDIR:-/tmp}/mctmpdir-uha.XXXXXX"` || exit 1
+    cd "$TMPDIR"
 
     $HA xyq "$1" "$2" >/dev/null
     cat "$2" > "$3"
 
     cd /
-    rm -rf $TMPDIR
+    rm -rf "$TMPDIR"
 }
 
 cmd="$1"
Index: vfs/extfs/ulha.in
===================================================================
RCS file: /cvsroot/mc/mc/vfs/extfs/ulha.in,v
retrieving revision 1.10
diff -u -p -u -p -r1.10 ulha.in
--- vfs/extfs/ulha.in	17 Aug 2004 08:24:59 -0000	1.10
+++ vfs/extfs/ulha.in	10 Nov 2004 06:43:53 -0000
@@ -98,30 +98,30 @@ mc_lha_fs_copyin ()
    NAME2=`basename "$2"`; DIR2=${2%$NAME2}
    NAME3=`basename "$3"`; DIR3=${3%$NAME3}
 
-   cd ${DIR3}
+   cd "${DIR3}"
 
    ONE2=${2%%/*}
-   [ -n ${ONE2} ] || exit 1
-   [ -e ${ONE2} ] && exit 1
+   [ -n "${ONE2}" ] || exit 1
+   [ -e "${ONE2}" ] && exit 1
 
-   [ -e ${DIR2} ] || mkdir -p ${DIR2}
+   [ -e "${DIR2}" ] || mkdir -p "${DIR2}"
    ln "$3" "$2"       || exit 1
 
    $LHA_PUT "$1" "$2"
-   rm -r ${ONE2}
+   rm -r "${ONE2}"
 }
 
 # The 'run' command executive to run a command from within an archive
 
 mc_lha_fs_run()
 {
-   TMPDIR=`mktemp -d ${MC_TMPDIR:-/tmp}/mctmpdir-ulha.XXXXXX` || exit 1
+   TMPDIR=`mktemp -d "${MC_TMPDIR:-/tmp}/mctmpdir-ulha.XXXXXX"` || exit 1
    trap "rm -rf $TMPDIR; exit 0" 1 2 3 4 15
    TMPCMD=$TMPDIR/run
    $LHA_GET "$1" "$2" > $TMPCMD  
-   chmod a+x $TMPCMD
-   $TMPCMD
-   rm -rf $TMPDIR
+   chmod a+x "$TMPCMD"
+   "$TMPCMD"
+   rm -rf "$TMPDIR"
 }
 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]