Remove 1986/hague alt code, make main entry
I fixed it so that the form where it would segfault (after printing the correct output) no longer occurs. The thanks file has had a note added towards the top about changing to fgets(), noting that although more is mentioned in the FAQ, it can be a real problem with some systems. The best example of it being beneficial is 1990/tbr. Naturally I also updated the thanks file for 1986/hague too, updating the details.
This commit is contained in:
1 parent
dc57ef5c78
commit
baec52c901
5 files changed
+21
-38
No files matched your search
+3
-5
@@ -63,7 +63,7 @@ CDEFINE=
|
||||
|
||||
# Include files that are needed to compile
|
||||
#
|
||||
CINCLUDE= -include stdio.h -include unistd.h
|
||||
CINCLUDE= -include stdio.h -include unistd.h -include string.h
|
||||
|
||||
# Optimization
|
||||
#
|
||||
@@ -114,8 +114,8 @@ OBJ= ${PROG}.o
|
||||
DATA=
|
||||
TARGET= ${PROG}
|
||||
#
|
||||
ALT_OBJ= ${PROG}.alt.o
|
||||
ALT_TARGET= ${PROG}.alt
|
||||
ALT_OBJ=
|
||||
ALT_TARGET=
|
||||
|
||||
|
||||
#################
|
||||
@@ -131,8 +131,6 @@ all: data ${TARGET}
|
||||
sandwich supernova deep_magic magic charon pluto
|
||||
|
||||
${PROG}: ${PROG}.c
|
||||
@echo "NOTE: this entry uses gets() so you might get a warning about this"
|
||||
@echo " when compiling and running this program with some systems."
|
||||
${CC} ${CFLAGS} $< -o $@ ${LDFLAGS}
|
||||
|
||||
# alternative executable
|
||||
|
||||
@@ -9,10 +9,6 @@ UK
|
||||
make all
|
||||
```
|
||||
|
||||
There is an alternate version which uses `fgets()`. See the Alternate code
|
||||
section below as well as the [bugs.md](/bugs.md) file for more details as to why
|
||||
it is worth having as an alternate version.
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
@@ -35,24 +31,6 @@ Also try:
|
||||
echo IOCCC | ./hague 2>/dev/null
|
||||
```
|
||||
|
||||
## Alternate code:
|
||||
|
||||
Whereas with some entries the change to `fgets()` (see the [FAQ](/faq.md) for
|
||||
details on why this has been done) can be done in the original code this entry
|
||||
is more complicated in that although both forms of input show the correct
|
||||
output, one form segfaults after the output.
|
||||
|
||||
If you wish to use this alternate code, do:
|
||||
|
||||
```sh
|
||||
make alt
|
||||
```
|
||||
|
||||
Use `hague.alt` as you would `hague` above. As for which form will segfault
|
||||
after outputting the text it is when text is piped into the program. Again see
|
||||
the [bugs.md](/bugs.md) file for more details.
|
||||
|
||||
|
||||
|
||||
## Judges' remarks:
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ DITDAH _DIT,DITDAH DAH_,DITDAH DIT_,
|
||||
DITDAH _DIT_,DITDAH DIT_DAH DIT
|
||||
DAH,DITDAH DAH_DIT DIT DAH;DAHDIT
|
||||
DIT _DIT=DIT_DAH DIT 81 DAH,DIT_=_DIT
|
||||
__DAH;_DIT=DAH_DIT DIT _DIT,81,stdin DAH,_DIT[strlen(_DIT)-1]='\0',_DIT!=NULL;__DIT
|
||||
__DAH;_DIT==DAH_DIT DIT _DIT,81,stdin DAH&&(_DIT[strlen(_DIT)-1]='\0',_DIT);__DIT
|
||||
DIT'\n'DAH DAH DAHDIT DIT DAH_=_DIT;DITDAH
|
||||
DAH_;__DIT DIT DITDAH
|
||||
_DIT_?_DAH DIT DITDAH DIT_ DAH:'?'DAH,__DIT
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
#define DITDAH *
|
||||
#define DAHDIT for
|
||||
#define DIT_DAH malloc
|
||||
#define DAH_DIT gets
|
||||
#define DAH_DIT fgets
|
||||
#define _DAHDIT char
|
||||
_DAHDIT _DAH_[]="ETIANMSURWDKGOHVFaLaPJBXCYZQb54a3d2f16g7c8a90l?e'b.s;i,d:"
|
||||
;main DIT DAH{_DAHDIT
|
||||
@@ -12,7 +12,7 @@ DITDAH _DIT,DITDAH DAH_,DITDAH DIT_,
|
||||
DITDAH _DIT_,DITDAH DIT_DAH DIT
|
||||
DAH,DITDAH DAH_DIT DIT DAH;DAHDIT
|
||||
DIT _DIT=DIT_DAH DIT 81 DAH,DIT_=_DIT
|
||||
__DAH;_DIT==DAH_DIT DIT _DIT DAH;__DIT
|
||||
__DAH;_DIT==DAH_DIT DIT _DIT,81,stdin DAH&&(_DIT[strlen(_DIT)-1]='\0',_DIT);__DIT
|
||||
DIT'\n'DAH DAH DAHDIT DIT DAH_=_DIT;DITDAH
|
||||
DAH_;__DIT DIT DITDAH
|
||||
_DIT_?_DAH DIT DITDAH DIT_ DAH:'?'DAH,__DIT
|
||||
|
||||
Reference in new issue
Block a user