Change "expr" to "expr --" in all shell scripts. Fixes: #889
authorNigel Metheringham <nigel@exim.org>
Fri, 30 Oct 2009 15:14:04 +0000 (15:14 +0000)
committerNigel Metheringham <nigel@exim.org>
Fri, 30 Oct 2009 15:14:04 +0000 (15:14 +0000)
doc/doc-txt/ChangeLog
src/scripts/exim_install
src/src/exicyclog.src
src/src/exinext.src

index 42a5926e45ad31a9ce6a505a4c3eaf983b1e927c..8e6d5b0c42322159081742f24d5e35aad8cc3fa9 100644 (file)
@@ -1,4 +1,4 @@
-$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.584 2009/10/30 15:08:25 nm4 Exp $
+$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.585 2009/10/30 15:14:04 nm4 Exp $
 
 Change log file for Exim from version 4.21
 -------------------------------------------
 
 Change log file for Exim from version 4.21
 -------------------------------------------
@@ -139,6 +139,9 @@ NM/30 Bugzilla 888: TLS documentation bugfixes
 
 NM/31 Bugzilla 896: Dovecot buffer overrun fix
 
 
 NM/31 Bugzilla 896: Dovecot buffer overrun fix
 
+NM/32 Bugzilla 889: Change all instances of "expr" in shell scripts to "expr --"
+      Unlike the original bugzilla I have changed all shell scripts in src tree
+
 
 Exim version 4.69
 -----------------
 
 Exim version 4.69
 -----------------
index 2f70c6e35fa99b740c5eca9575f5937d2e6acb34..616ab3c16bc270dad6dd2464db15c0970888f322 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
 #! /bin/sh
-# $Cambridge: exim/src/scripts/exim_install,v 1.2 2005/09/06 13:18:13 ph10 Exp $
+# $Cambridge: exim/src/scripts/exim_install,v 1.3 2009/10/30 15:14:04 nm4 Exp $
 
 # Script to install Exim binaries in BIN_DIRECTORY, which is defined in
 # the local Makefile. It expects to be run in a build directory. It needs
 
 # Script to install Exim binaries in BIN_DIRECTORY, which is defined in
 # the local Makefile. It expects to be run in a build directory. It needs
@@ -378,7 +378,7 @@ done
 
 echo $com ""
 
 
 echo $com ""
 
-if [ `expr "${CONFIGURE_FILE}" : ".*:"` -ne 0 ] ; then
+if [ `expr -- "${CONFIGURE_FILE}" : ".*:"` -ne 0 ] ; then
   echo $com Runtime configuration is specified as the following list:
   echo $com ' ' ${CONFIGURE_FILE}
   echo $com Therefore, skipping automatic installation.
   echo $com Runtime configuration is specified as the following list:
   echo $com ' ' ${CONFIGURE_FILE}
   echo $com Therefore, skipping automatic installation.
index c1af5d1793dc014af2bd0064c19ef155d03f9700..097de7eaa0fc1e0a466259607019441ee41129a9 100644 (file)
@@ -1,5 +1,5 @@
 #! /bin/sh
 #! /bin/sh
-# $Cambridge: exim/src/src/exicyclog.src,v 1.9 2009/01/20 16:06:14 fanf2 Exp $
+# $Cambridge: exim/src/src/exicyclog.src,v 1.10 2009/10/30 15:14:04 nm4 Exp $
 
 # Copyright (c) 2006 University of Cambridge.
 # See the file NOTICE for conditions of use and distribution.
 
 # Copyright (c) 2006 University of Cambridge.
 # See the file NOTICE for conditions of use and distribution.
@@ -251,7 +251,7 @@ count=$keep
 if [ $count -lt 10 ]; then countt=0$count; else countt=$count; fi
 
 while [ $count -gt 1 ]; do
 if [ $count -lt 10 ]; then countt=0$count; else countt=$count; fi
 
 while [ $count -gt 1 ]; do
-  old=`expr $count - 1`
+  old=`expr -- $count - 1`
   if [ $keep -gt 99 ]; then
     if   [ $old -lt 10 ]; then oldt=00$old
     elif [ $old -lt 100 ]; then oldt=0$old
   if [ $keep -gt 99 ]; then
     if   [ $old -lt 10 ]; then oldt=00$old
     elif [ $old -lt 100 ]; then oldt=0$old
@@ -334,7 +334,7 @@ while [ $count -le $keep ]; do
     $chown $user:$group $paniclog.$countt.$suffix
   fi
 
     $chown $user:$group $paniclog.$countt.$suffix
   fi
 
-  count=`expr $count + 1`
+  count=`expr -- $count + 1`
 done
 
 # End of exicyclog
 done
 
 # End of exicyclog
index 7fe80c796312fe0ba0d51e9de077947a1a747f2d..80d63697283151c5e4e07b1c6fa32a8c73db5840 100644 (file)
@@ -1,5 +1,5 @@
 #! /bin/sh
 #! /bin/sh
-# $Cambridge: exim/src/src/exinext.src,v 1.3 2007/07/29 21:49:46 magnus Exp $
+# $Cambridge: exim/src/src/exinext.src,v 1.4 2009/10/30 15:14:04 nm4 Exp $
 
 # Copyright (c) 1996-2004 University of Cambridge.
 # See the file NOTICE for conditions of use and distribution.
 
 # Copyright (c) 1996-2004 University of Cambridge.
 # See the file NOTICE for conditions of use and distribution.
@@ -26,16 +26,16 @@ config=
 eximmacdef=
 exim_path=
 
 eximmacdef=
 exim_path=
 
-if expr $1 : '\-' >/dev/null ; then
-  while expr $1 : '\-' >/dev/null ; do
+if expr -- $1 : '\-' >/dev/null ; then
+  while expr -- $1 : '\-' >/dev/null ; do
     if [ "$1" = "-C" ]; then
       config=$2
       shift
       shift
     if [ "$1" = "-C" ]; then
       config=$2
       shift
       shift
-    elif expr $1 : '\-D' >/dev/null ; then
+    elif expr -- $1 : '\-D' >/dev/null ; then
       eximmacdef="$eximmacdef $1"
       eximmacdef="$eximmacdef $1"
-      if expr $1 : '\-DEXIM_PATH=' >/dev/null ; then
-        exim_path=`expr $1 : '\-DEXIM_PATH=\(.*\)'`
+      if expr -- $1 : '\-DEXIM_PATH=' >/dev/null ; then
+        exim_path=`expr -- $1 : '\-DEXIM_PATH=\(.*\)'`
       fi
       shift
     else
       fi
       shift
     else