OSSP CVS Repository

ossp - Check-in [4500]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 4500
Date: 2004-Apr-07 09:55:02 (local)
2004-Apr-07 07:55:02 (UTC)
User:rse
Branch:
Comment: Replace "tr 'x-' 'x_'" with "sed -e 's/-/_/g'" constructs because some tr(1) (at least Solaris' /usr/ucb/tr) go into endless loops on (incorrectly assumed) range constructs with no ends.

Submitted by: Armin Wolfermann <aw@osn.de>

Tickets:
#41 shtool broken on Solaris when using /usr/ucb/tr
Inspections:
Files:
ossp-pkg/shtool/ChangeLog      1.197 -> 1.198     6 inserted, 1 deleted
ossp-pkg/shtool/sh.common      1.22 -> 1.23     3 inserted, 3 deleted

ossp-pkg/shtool/ChangeLog 1.197 -> 1.198

--- ChangeLog    2004/02/18 09:55:01     1.197
+++ ChangeLog    2004/04/07 07:55:02     1.198
@@ -9,7 +9,12 @@
 
  ChangeLog
 
- Changes between 1.6.2 and 2.0b1 (02-Nov-2002 to 18-Feb-2004):
+ Changes between 1.6.2 and 2.0b1 (02-Nov-2002 to 07-Apr-2004):
+
+   *) Replace "tr 'x-' 'x_'" with "sed -e 's/-/_/g'" constructs
+      because some tr(1) (at least Solaris' /usr/ucb/tr) go into endless
+      loops on (incorrectly assumed) range constructs with no ends.
+      [Armin Wolfermann <aw@osn.de>]
 
    *) Fix typos in various files.
       [Thomas Lotterer <thomas@lotterer.net>]


ossp-pkg/shtool/sh.common 1.22 -> 1.23

--- sh.common    2003/12/13 21:23:55     1.22
+++ sh.common    2004/04/07 07:55:02     1.23
@@ -47,7 +47,7 @@
 
 #   parse option alias string
 eval `echo h:help,$opt_alias |\
-      tr 'x-' 'x_' | sed -e 's/\([a-zA-Z0-9]\):\([^,]*\),*/opt_ALIAS_\2=\1;/g'`
+      sed -e 's/-/_/g' -e 's/\([a-zA-Z0-9]\):\([^,]*\),*/opt_ALIAS_\2=\1;/g'`
 
 #   interate over argument line
 opt_PREV=''
@@ -72,12 +72,12 @@
             --[a-zA-Z0-9]*=*)
                 eval `echo "x$1" |\
                       sed -e 's/^x--\([a-zA-Z0-9-]*\)=\(.*\)$/opt_OPT="\1";opt_ARG="\2"/'`
-                opt_STR=`echo $opt_OPT | tr 'x-' 'x_'`
+                opt_STR=`echo $opt_OPT | sed -e 's/-/_/g'`
                 eval "opt_OPT=\${opt_ALIAS_${opt_STR}-${opt_OPT}}"
                 ;;
             --[a-zA-Z0-9]*)
                 opt_OPT=`echo "x$1" | cut -c4-`
-                opt_STR=`echo $opt_OPT | tr 'x-' 'x_'`
+                opt_STR=`echo $opt_OPT | sed -e 's/-/_/g'`
                 eval "opt_OPT=\${opt_ALIAS_${opt_STR}-${opt_OPT}}"
                 opt_ARG=''
                 ;;

CVSTrac 2.0.1