From d91bced2b8dc83e5aecc37b2b2a4f45c07221966 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sun, 14 Jan 2024 05:28:07 -0800 Subject: [PATCH] Fix funny problem in 1989/fubar In some cases if one were to modify the C code (possibly the same with the script) in certain ways the program would fail to work even after changing the code back. Trying to figure out what to put in bugs.md and on a hunch, changing the fubar.sh script (in particular the ex(1) part) remedies the problem (or so it seems from the various tests I have performed including some that caused a problem). In particular: --- i/1989/fubar/fubar.sh +++ w/1989/fubar/fubar.sh @@ -7,13 +7,12 @@ if [[ $# -ne 1 ]]; then exit 1 fi # run/compile it rm -f ouroboros.c x1 x -ex - < x1 +cat ouroboros.c | ./x $1 > x1 if [[ $? -ne 0 ]]; then exit fi -mv x1 ./ouroboros.c -chmod +x ./ouroboros.c +mv x1 ouroboros.c +chmod +x ouroboros.c exec ./ouroboros.c $1 exit */ diff --git a/1989/fubar/fubar.sh b/1989/fubar/fubar.sh index 816a1147d..74929c5ea 100755 --- a/1989/fubar/fubar.sh +++ b/1989/fubar/fubar.sh @@ -9,8 +9,7 @@ fi # run/compile it rm -f ouroboros.c x1 x -ex - <