summaryrefslogtreecommitdiffstatshomepage
path: root/strings.sh
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-03-08 19:32:03 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-03-08 19:32:03 +0000
commit82ebd2e467651cc6ec63d8a1bc9b6e5cedb01410 (patch)
tree334ace4e3affb063a3c1df0ad995850a23af77ff /strings.sh
parentdc7c7fae796f0d87b47ae5747a1820e7173380a0 (diff)
downloadmandoc-82ebd2e467651cc6ec63d8a1bc9b6e5cedb01410.tar.gz
mandoc-82ebd2e467651cc6ec63d8a1bc9b6e5cedb01410.tar.zst
mandoc-82ebd2e467651cc6ec63d8a1bc9b6e5cedb01410.zip
Fixed strings.sh to work with NetBSD.
Fixed various lint warnings.
Diffstat (limited to 'strings.sh')
-rw-r--r--strings.sh15
1 files changed, 9 insertions, 6 deletions
diff --git a/strings.sh b/strings.sh
index 18c54f28..54a00d4e 100644
--- a/strings.sh
+++ b/strings.sh
@@ -1,5 +1,5 @@
#! /bin/sh
-# $Id: strings.sh,v 1.2 2009/03/06 14:24:49 kristaps Exp $
+# $Id: strings.sh,v 1.3 2009/03/08 19:32:03 kristaps Exp $
# strings.sh [-o output] name input
#
@@ -45,11 +45,11 @@ fi
input=$2
if [ "$output" ]; then
- exec 1<>$output
+ exec >$output
fi
if [ "$input" ]; then
- exec 0<>$input
+ exec <$input
fi
cat <<!
@@ -67,9 +67,12 @@ mdoc_a2${name}(const char *p)
!
while read in ; do
- [ -z "$in" ] && continue;
- [ "#" == `echo "$in" | cut -c1` ] && continue;
-
+ if [ -z "$in" ]; then
+ continue
+ fi
+ if [ "#" = `echo "$in" | cut -c1` ]; then
+ continue
+ fi
key=`printf "%s\n" "$in" | cut -f 1`
val=`printf "%s\n" "$in" | cut -f 2- | sed 's!^[ ]*!!'`
cat <<!