handle tools lossage in fsinfo
authorChristos Zoulas <christos@zoulas.com>
Wed, 17 Sep 2008 20:04:40 +0000 (20:04 +0000)
committerChristos Zoulas <christos@zoulas.com>
Wed, 17 Sep 2008 20:04:40 +0000 (20:04 +0000)
ylwrap

diff --git a/ylwrap b/ylwrap
index 408c1e0c5e6c7293cbb0ee853b9df2ec6dc1ed98..8a9b8397284f627071db8b11fc5e074898ce2447 100755 (executable)
--- a/ylwrap
+++ b/ylwrap
@@ -185,8 +185,16 @@ if test $ret -eq 0; then
                -e 's/_parse.[yl]$/_/g' \
                -e 's/_tok.[yl]$/_/g'`
 
+      case $prefix in
+      *.y)
+             code_prefix="$(basename $prefix _gram.y)_yy";;
+      *.l)
+             code_prefix="$(basename $prefix _lex.l)_yy";;
+      *)
+             code_prefix="$prefix";;
+      esac
       sed -e "/^#/!b" -e "s,$input_rx,," -e "s,$from,$2," \
-          -e "s,$FROM,$TARGET," "$from" | sed "s/yy/$prefix/g" > "$target" || ret=$?
+          -e "s,$FROM,$TARGET," "$from" | sed "s/yy/$code_prefix/g" > "$target" || ret=$?
 
       # Check whether header files must be updated.
       if test $first = no; then