From 8946cff4fad9cb924832305c60efa79f0d08f21d Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Mon, 30 Oct 2023 05:00:52 -0700 Subject: [PATCH] Fix 2001/schweikh - check args This was not documented. The limitations have not been addressed as they were documented. The bugs.md and README.md have been updated for this. --- 2001/schweikh/README.md | 2 +- 2001/schweikh/schweikh.c | 2 +- bugs.md | 25 +++---------------------- thanks-for-fixes.md | 6 ++++++ 4 files changed, 11 insertions(+), 24 deletions(-) diff --git a/2001/schweikh/README.md b/2001/schweikh/README.md index dbd19f061..af487a8fd 100644 --- a/2001/schweikh/README.md +++ b/2001/schweikh/README.md @@ -16,7 +16,7 @@ make The current status of this entry is: ``` -STATUS: known bug - please help us fix +STATUS: INABIAF - please **DO NOT** fix ``` For more detailed information see [2001 schweikh in bugs.md](/bugs.md#2001-schweikh). diff --git a/2001/schweikh/schweikh.c b/2001/schweikh/schweikh.c index b24af7599..e0dd12282 100644 --- a/2001/schweikh/schweikh.c +++ b/2001/schweikh/schweikh.c @@ -1 +1 @@ -main(int c,char**v){return!m(v[1],v[2]);}m(char*s,char*t){return*t-42?*s?63==*t|*s==*t&&m(s+1,t+1):!*t:m(s,t+1)||*s&&m(s+1,t);} +main(int c,char**v){return c<3?1:!m(v[1],v[2]);}m(char*s,char*t){return*t-42?*s?63==*t|*s==*t&&m(s+1,t+1):!*t:m(s,t+1)||*s&&m(s+1,t);} diff --git a/bugs.md b/bugs.md index 401783f9f..dc2b412dc 100644 --- a/bugs.md +++ b/bugs.md @@ -1342,22 +1342,15 @@ This program will very likely crash or do something else without an arg. If you want to try and fix this (mis)feature, you are welcome to try. -## 2001 schweikh - -### STATUS: known bug - please help us fix +### STATUS: INABIAF - please **DO NOT** fix ### Source code: [2001/schweikh/schweikh.c](2001/schweikh/schweikh.c) ### Information: [2001/schweikh/README.md](2001/schweikh/README.md) -This program will very likely crash or do something else if you do not give it -two args. - -Note also that the glob pattern must match the whole string. See the author's -comments for details and a workaround. +The glob pattern must match the whole string. See the author's comments for +details and a workaround. There's also no way to escape meta characters. -If you want to try and fix this (mis)feature, you are welcome to try. - # 2002 @@ -1569,18 +1562,6 @@ Fixing the (Mis)feature is likely to be a difficult challenge. You are welcome to try and fix it if you can! -## 2006 stewart - -### STATUS: known bug - please help us fix -### Source code: [2006/stewart/stewart.c](2006/stewart/stewart.c) -### Information: [2006/stewart/README.md](2006/stewart/README.md) - -This program will very likely crash or do something funny if the file does not -exist or cannot be opened. - -If you want to try and fix this (mis)feature, you are welcome to try. - - ## 2006 toledo2 ### STATUS: INABIAF - please **DO NOT** fix diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index 9e5151303..3d4252517 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -1830,6 +1830,12 @@ the paddles move even when holding down the movement keys. Cody also provided an alternate version which lets you use the arrow keys on your keyboard instead of the more awkward '`,`' and '`.`'. +## [2001/schweikh](2001/schweikh/schweikh.c) ([README.md](2001/schweikh/README.md])) + +Cody fixed this to not crash if not enough args as this was not documented by +the author. The other problems are documented so were not fixed. See +README.md for details. + ## [2001/westley](2001/westley/westley.c) ([README.md](2001/westley/README.md]))