make jsh compatible (Heirloom sh)

This commit is contained in:
tg 2013-11-20 20:55:01 +00:00
parent 973c7a55c2
commit 47ba4d13b4
1 changed files with 3 additions and 8 deletions

View File

@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
# $MirOS: src/bin/mksh/genopt.sh,v 1.2 2013/11/17 22:22:51 tg Exp $ # $MirOS: src/bin/mksh/genopt.sh,v 1.3 2013/11/20 20:55:01 tg Exp $
#- #-
# Copyright (c) 2013 # Copyright (c) 2013
# Thorsten Glaser <tg@mirbsd.org> # Thorsten Glaser <tg@mirbsd.org>
@ -43,12 +43,6 @@ allu=QWERTYUIOPASDFGHJKLZXCVBNM
alll=qwertyuiopasdfghjklzxcvbnm alll=qwertyuiopasdfghjklzxcvbnm
nl=' nl='
' '
me=`basename "$0"`
curdir=`pwd` srcdir=`dirname "$0" 2>/dev/null`
case x$srcdir in
x) srcdir=. ;;
*"'"*) echo Source directory must not contain single quotes.; exit 1 ;;
esac
die() { die() {
if test -n "$1"; then if test -n "$1"; then
@ -101,6 +95,7 @@ do
o_sym= o_sym=
ddefs= ddefs=
state=0 state=0
exec <"$srcfile"
while IFS= read -r line; do while IFS= read -r line; do
case $state:$line in case $state:$line in
2:'|'*) 2:'|'*)
@ -157,7 +152,7 @@ do
test -n "$cond" && o_gen=$o_gen$nl"#endif" test -n "$cond" && o_gen=$o_gen$nl"#endif"
;; ;;
esac esac
done <"$srcfile" done
case $state:$o_sym in case $state:$o_sym in
3:) die Expected optc sym at EOF ;; 3:) die Expected optc sym at EOF ;;
3:*) ;; 3:*) ;;