fix experimental web site links in experimental index.html
sync CNAME with https://github.com/ioccc-src/winner/blob/master/CNAME
improve .gitignore files
Added to each .gitignore file, comments on how to sort.
Put into winner .gitignore files, ignore *.dSYM files.
Put into winner .gitignore files, ignore indent.c,
indent.o and indent files. This is done so that the
winner directory can more self contained.
We did not put into winner .gitignore files, however,
excludes of .-files as found in the top level .gitignore file.
As .-files are not allowed by mkiocccentry, the top level
.gitignore file remains sufficient.
Added to year level .gitignore files, excludes of
mkentry or iocccsize files as needed.
Sorted (via sort -d -u) all .gitignore file.
Due to the fact we now have .orig.c files and thus the possibility of
winner.orig or prog.orig being built I have updated all the .gitignore
files so that these files ignored. This was done with the following
shell commands, for reference:
for i in $(find 19* 200* 201[0123] -mindepth 2 -maxdepth 2 -name .gitignore) ; do echo $(dirname "$i"|sed -e 's,[0-9]\{4\}/,,g').orig >> "$i"; done
for i in $(find 201[4-9] 2020 -mindepth 2 -maxdepth 2 -name .gitignore) ; do echo prog.orig >> "$i"; done
and the two commands is because it was only in 2014 that the winning
entries were renamed to prog so prog.orig is the correct glob.
The alt code was the version that works for modern systems before the
gets()/fgets() change (the fix being changing a read only char * to a
char []) but this is not at this time in the archive. The README.md file
refers to the archive, noting it is the original code before the bug
fix.
As both Landon and I have been wondering if changing entries to use
fgets() is bordering on tampering with entries I decided to make the
original (sometimes bug fixed) versions (using gets()) alt code. I had
originally started to make the fgets() version of each entry the alt but
since the fgets() versions can handle input better and since some also
fixed bugs (see below) I decided to make the original version the alt
code (this also is how it is for other entries).
There were some exceptions here. If the change also fixed some crashes
or other bugs outside of the gets() to fgets() conversion I did not
bother to make an alt version. An example is 1992/dds. In some cases the
alt code does have bug fixes in which case they were added.
Updated the Makefiles and .gitignore files as well for the alt target
and the new files (compiled and in the case of 1992/adrian additional
source files in the Makefile alt rule).
This should solve the problem observed by Landon and me. It wouldn't be
a problem to change it so the alt version is the one that uses fgets()
but I think that might be the wrong choice.
In some entries I altogether avoided changing to fgets() say if the
author notes it uses gets() (in one case even providing a version that
uses fgets()). In some cases using fgets() introduces a bug so those are
also not changed.
As for 1990/tbr there's a strong reason for not having the fgets()
version being the alt. In macOS in particular (in linux - or maybe gcc,
not sure - it shows a warning at linker time) it will mess up the first
line of output in a potentially confusing way. For instance:
$ ./tbr.alt
$ warning: this program uses gets(), which is unsafe.
# nothing here, what to do?
And that touches on another issue of making the alt version the one that
uses gets(): the warnings that can be alarming during compilation,
linking and (in the case of macOS) runtime.
Not all entries should be or can be changed to fgets() but some can and
it's warranted for these reasons. More will possibly happen in the
future.
As was discussed with Landon this was a mistake even if it helped with
consistency. There was even a brilliant pun that was destroyed with that
commit which I think is worth pointing out:
cp README.md hill
./ant hill
in 1991/ant ... even if it's technically 'anthill'.
I hope that I got all links fixed in years.html and winners.html. As
well I tried to make sure I got all handles fixed in all/summary.txt.
Nevertheless these should be checked. For some handles they were never
updated (at least in the html files - though maybe summary.txt too, not
sure) in the first place so there was nothing to do.
Typo fixes like references to *.hint when it should be README.md. There
probably are others that need to be fixed but haven't been located yet.
There were many files renamed in this commit and I hope I got all the
references to the old names changed to the new names. To explain this
commit there were some older entries that had the wrong directory name:
not the surname but something else.
Very possibly there are other directories that need to be renamed and I
am actually aware of one right now but since it's in 2005 (which is
close to being worked on) I am not changing that now but just noting it:
2005/anon should be changed to 2005/anonymous (unless there's a very
good reason I am unaware of). But like I said since 2005 will be worked
on soon I have not touched it.
The Makefiles, .gitignore, the all/summary.txt, years.html and
winners.html files as well as the directories and the files under the
renamed directories have all been updated.
This is a rather big update and it might be that there are conflicts. If
so I will fix them. I will have to update 2005/anon later on to try and
prevent this from happening but very possibly there will be conflicts
here. It's also possible I missed some changes in years.html and/or
winners.html and/or summary/all.txt but I think I got them all. These
should be verified later on.