X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=cde%2Fprograms%2Fdtprintinfo%2Fsym2num;h=0f554d8611654d0947faa7bd5d5f4a1b046dbbdb;hb=633ae90d90643143a8bb29a9c9d2667b95cbb334;hp=8799eb372a73538fcdc38efd308b25e7cb210e70;hpb=83b6996daa2c5ae22fc2b69093814cb08314954a;p=oweals%2Fcde.git diff --git a/cde/programs/dtprintinfo/sym2num b/cde/programs/dtprintinfo/sym2num index 8799eb37..0f554d86 100755 --- a/cde/programs/dtprintinfo/sym2num +++ b/cde/programs/dtprintinfo/sym2num @@ -10,13 +10,11 @@ # by gencat. # -typeset -u CAP_SYMBOL_NAME - (( $# != 2 )) && { print "usage: sym2num " ;\ exit 1 ; } SYMBOL_NAME=$1 -CAP_SYMBOL_NAME=$1 # capitalized symbol name +CAP_SYMBOL_NAME=`echo $1 | tr '[:lower:]' '[:upper:]'` # capitalized symbol SOURCE_FILE=$2 inc_file=${SYMBOL_NAME}_msg.h # include file @@ -58,11 +56,18 @@ awk '/^\$set/ { SET_NAME=$2; SET_COUNT++; MES_COUNT=0; if [[ -f /usr/ccs/lib/cpp ]] #IBM & SUN then cpp_path=/usr/ccs/lib +elif [[ -f /usr/libexec/cpp ]] #BSD +then + cpp_path=/usr/libexec +elif [[ -f /usr/bin/cpp ]] #BSD +then + cpp_path=/usr/bin elif [[ -f /lib/cpp ]] #HP then cpp_path=/lib fi ( cat ${inc_file} | sed -n /define/p ; cat ${SOURCE_FILE} ) | \ - ${cpp_path}/cpp -P | sed '/^$/d' | sed 's/^\([1-9][0-9]*\)[ ]*\(.*\)/\1 \2/' + ${cpp_path}/cpp -P | sed -e '/^$/d' -e 's/^\$$/\$ /' \ + -e 's/\"\"$/\"/' -e 's/XDQUOTE/\"/' -e "s/XSQUOTE/\'/" \ + -e 's/^\([1-9][0-9]*\)[ ]*[\"]*\(\"\)\(.*\)/\1 \2\3/' -