Improve fgets() fix to 1992/lush
gets() is now defined as the right fgets() call. This required the use of #line 1 as the entry uses compiler messages to work right. That's also why clang will not work with this entry.
This commit is contained in:
1 parent
2173be58f2
commit
aedc966d6d
2 files changed
+9
-2
No files matched your search
+4
-2
@@ -1,3 +1,5 @@
|
||||
#define gets(_) fgets((_),999,stdin)
|
||||
#line 1
|
||||
#define f 000:
|
||||
char
|
||||
*s,*
|
||||
@@ -63,8 +65,8 @@
|
||||
;;;}
|
||||
;for
|
||||
( ;
|
||||
fgets
|
||||
(_,999,stdin);
|
||||
gets
|
||||
(_);
|
||||
) {
|
||||
for(
|
||||
#define f 301:
|
||||
|
||||
@@ -585,6 +585,11 @@ which can be confusing) and also added the `runme.sh` script to demonstrate it
|
||||
(using make was problematic). Cody notes that unfortunately this does not work
|
||||
with clang due to different compiler messages.
|
||||
|
||||
Cody later improved the `fgets()` change to look more like the original i.e. it
|
||||
now uses a redefined `gets()`. This did require modifying the line number with
|
||||
`#line 1` under the macro `gets()`. Still this cannot work with clang due to
|
||||
different compiler messages. See [bugs.md](/bugs.md) for details.
|
||||
|
||||
|
||||
## [1992/westley](1992/westley/westley.c) ([README.md](1992/westley/README.md]))
|
||||
|
||||
|
||||
Reference in new issue
Block a user