Skip to content

Commit a0b09b5

Browse files
committed
Fix unlikely backslash bug in scripts
* tzselect.ksh, workman.sh: Use printf, not echo, if the argument might in theory contain a backslash.
1 parent 9609458 commit a0b09b5

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

tzselect.ksh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,11 @@ do
145145
t*) # Undocumented option, used for developer testing.
146146
zonetabtype=$OPTARG;;
147147
-help)
148-
exec echo "$usage";;
148+
say "$usage"
149+
exit;;
149150
-version)
150-
exec echo "tzselect $PKGVERSION$TZVERSION";;
151+
say "tzselect $PKGVERSION$TZVERSION"
152+
exit;;
151153
-*)
152154
say >&2 "$0: -$opt$OPTARG: unknown option; try '$0 --help'"; exit 1;;
153155
*)
@@ -516,8 +518,7 @@ while
516518
' ="$distance_table"
517519
)
518520
echo >&2 'Please select one of the following timezones,'
519-
echo >&2 'listed roughly in increasing order' \
520-
"of distance from $coord".
521+
say >&2 "listed roughly in increasing order of distance from $coord."
521522
doselect $regions
522523
region=$select_result
523524
tz=$(

workman.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ elif (type nroff && type perl) >/dev/null 2>&1; then
5151
}
5252
'
5353
else
54-
echo >&2 "$0: please install groff, or mandoc and col"
54+
printf >&2 '%s\n' "$0: please install groff, or mandoc and col"
5555
exit 1
5656
fi

0 commit comments

Comments
 (0)