Or else add an ostomy :-).
Some README.md files have severe ulcerative colitis and will need a
colectomies but others are missing colons. These will be discovered and
fixed in time. In the meantime I've restored some functionality for
these poor README.md files by giving them an ostomy.
After discussing it with Landon it was recommended that these fixes be
reapplied.
Updated bugs.md wrt this.
README.md has had formatting fixes as well.
Updated URL for author as it has changed. It's very little on his page
and the only page that suggests it is his is the ioccc.html page. I
couldn't find anything else.
As part of the redefinition of INABIAF two segfault fixes were undone.
These are noted in the Makefile and README.md file.
One fix was necessary and that has been left alone.
There were many many README.md files with the wrong heading level for
different sections. These have been changed.
To help go through the changes it should be noted I used sgit and also
here is what is changed:
The 'Try', 'To build' and 'To run' lines have two '#'s. Some had one and
others had three.
An exception is that in 1984/anonymous/README.md for the alternative
code that had three '#'s. This is not consistent yet and it might be
that only two are desired. But for now that one at least has three.
The program would also crash if the arg had any character that's not a
digit or if the arg had only 0s in it (it would work if it had 0
followed by a digit other than 0). In other words if it is converted to
0 it would segfault.
The bugs.md file has been updated as well to note what's also now in the
README.md file: even a relatively small number can cause a substantial
amount of lines of output. For instance the number 9 causes 771999 lines
(!!) of output.
For Makefiles that have alt related rules, moved
the related rules under the alt rule section.
In some cases where there is no alt code,
removed alt rules and/or targets.
I had updated it after a commit and thought I did a commit -v --amend
but apparently I did not (or I missed the README.md though I thought I
did '.'). Thus the README.md was not as it should be.
This was a fun one to figure out and fix!
The original code did not work; there were several things wrong with it
as below. The macOS version was even more complicated but also fun and
also described below.
The problem with the original was a bad call to freopen() where the arg
parameter was actually 5+__FILE__ when it should be "r" (though of
course it used to work fine). A call to fopen() had a similar mode:
44+__FILE__ though this actually did not seem to affect the output. But
it didn't work with macOS at all. The following is some of what I put in
the README.md so that one can see here too what was wrong. Spoilers for
the original entry (at least some spoilers) are here!
For this alternative version you will need the command line tools which
you can install like:
```sh
sudo xcode-select --install
```
This how it works: if you look at line 55 you see a funny command.
This goes for both versions. Now the key are two magic numbers, one on a
different line shortly below the string. In the original the numbers are,
respectively, 44 and 46. But how does this work? Well the string is:
"0gcc -ansi -E -dM -undef %s /usr/include/%s>r\0 ("
The first number means: the length starting from 0 up through the `>`. The
second number is the same starting point but up through the `\0` which is why
it's +2. Somehow it was basic intuition that made me figure out these
two numbers and a quick test confirmed it. But what happens if only the
first number is updated? Most of the output will be just `#define` by
itself; in the cases where there was text after that it was macros that
certainly were not defined. There might have been other errors as well.
This allows for opening the right files. The problem with the macOS is
/usr/include does not exist: instead it's
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include which is
why the different command line and the different numbers.
It said that the program will fail if the program's name's second letter
isn't r but this restriction was removed for publication so I changed it
to past tense.
Simply the Makefile header.
Refer to the //www.ioccc.org/bugs.md URL (that will eventually exist).
Now using CC BY-SA 4.0 License to how you may share and adapt the
Makefile.
The problem with not calling 'endwin()' is that echo will be disabled
which is a problem for the user if they don't know to type stty echo or
reset or stty sane.
I removed from bugs.md the suggestion that it does not work for macOS as
I fixed that. I also slightly reworded the entry in bugs.md (about
warnings to ignore).
Add to README.md summary of problem.
It segfaulted due to wrong type of a variable.
It still crashes under macOS which I will be looking at in the near
future but it at least works for linux.
I noted in the bugs.md a compiler warning that should not be changed as
it's not a bug and in fact 'fixing' it will introduce a bug.
Formatting and other notes. Many more need to be checked for this but I
wanted these changes out of the way of git status to try and clean my
working changes.
The formatting of README.md has been changed.
Added a try section and a duplicate file to the directory (copy of
samefile.1) so that the users can see how it looks. The copy is
samefile1.1.dupe. Yes dupe means to deceive and also a victim of being
deception but it also means duplicate. For the IOCCC though it actually
makes sense if a file (in fact all the source files :-) and thus you're
a dupe! :-)
Some systems need it to link in libm. Fedora comes to mind as an
example; macOS has no problem with it though running this entry under
macOS is another matter entirely.
In years < 2001 (with the exception of ferguson2/) that still have
reference to *.hint files they have been changed to README.md with the
following exception: in 1998/dorssel there was a dorssel.hint2. This was
changed to dorssel.hint since the dorssel.hint was changed to README.md
a while back. The references to dorssel.hint2 were changed to without
the 2.
There was an out of date reference in faq.html file to a .hint file as
well that was updated to README.md; the dorssel2.hint in years.html was
changed to the new name.
With that the only files that have to be updated are those that are >=
2001. I still have to check for hint.* however.
The commit 00ae59cd47 had a
mistake that introduces changes to Makefiles for 1996 thru 2020
that should not have been included.
This change reverses these intermediate changes until
the given year's Makefiles are ready.