]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
ylwrap: trivial shell fixes.
authorKarl Berry <karl@freefriends.org>
Sat, 20 Sep 2025 21:48:47 +0000 (14:48 -0700)
committerKarl Berry <karl@freefriends.org>
Sat, 20 Sep 2025 21:48:47 +0000 (14:48 -0700)
* lib/ylwrap: exit if cd fails,  quote args to test, doc typos.

lib/ylwrap

index 7c1dc93e00aeaac08885956d429fa345ed4e60ba..62aed82da4f38a12dfca3f716ae1ba66b7b86a9d 100755 (executable)
@@ -1,7 +1,7 @@
 #! /bin/sh
 # ylwrap - wrapper for lex/yacc invocations.
 
-scriptversion=2025-06-18.21; # UTC
+scriptversion=2025-09-20.21; # UTC
 
 # Copyright (C) 1996-2025 Free Software Foundation, Inc.
 #
@@ -96,7 +96,7 @@ esac
 # The input.
 input=$1
 shift
-# We'll later need for a correct munging of "#line" directives.
+# We'll later need this for a correct munging of "#line" directives.
 input_sub_rx=`get_dirname "$input" | quote_for_sed`
 case $input in
   [\\/]* | ?:[\\/]*)
@@ -167,7 +167,7 @@ trap "ret=141; $do_exit" 13
 trap "ret=143; $do_exit" 15
 mkdir $dirname || exit 1
 
-cd $dirname
+cd $dirname || exit 1
 
 case $# in
   0) "$prog" "$input" ;;
@@ -192,7 +192,7 @@ if test $ret -eq 0; then
       # destination of the .y.c rule in the Makefile.  Divert the
       # output of all other files to a temporary file so we can
       # compare them to existing versions.
-      if test $from != $parser; then
+      if test "$from" != "$parser"; then
         realtarget=$target
         target=tmp-`printf '%s\n' "$target" | sed 's|.*[\\/]||g'`
       fi