diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-03-08 19:32:03 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-03-08 19:32:03 +0000 |
commit | 82ebd2e467651cc6ec63d8a1bc9b6e5cedb01410 (patch) | |
tree | 334ace4e3affb063a3c1df0ad995850a23af77ff /strings.sh | |
parent | dc7c7fae796f0d87b47ae5747a1820e7173380a0 (diff) | |
download | mandoc-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.sh | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -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 <<! |