force use of pandoc version >= 3.1.12.2
The `bin/pandoc-wrapper.sh` tool will verify that the ssytem has a recent enough version of `pandoc(1)`. We explain why we insist on `pandoc(1)`. version >= 3.1.12.2 in comments where the $PANDOC_MIN_VERSION is set. Added `--wrap=preserve` as a default argument to `pandoc(1)`. While this change will impact every HTML file generated, we believe this will improve the ability of someone to look at the generated HTML and correlate with the original markdown. Changed `bin/pandoc-wrapper.sh` VERSION from "1.4.2 2024-03-17" to "1.4.3 2024-03-18". Performed `make www` to achieve all of the above and to generate HTML using the new `--wrap=preserve` `pandoc(1)` mode.
This commit is contained in:
1 parent
9eb7a54e9f
commit
b0b212acb1
402 files changed
+37061
-55132
No files matched your search
+76
-109
@@ -129,12 +129,12 @@
|
||||
|
||||
<h2 id="authors"><a name="author"></a>Authors:</h2>
|
||||
<ul>
|
||||
<li>Name: <a href="../../authors.html#Byron_Rakitzis">Byron
|
||||
Rakitzis</a><br> Location: <a href="../../location.html#US">US</a> -
|
||||
<em>United States of America</em> (<em>United States</em>) <br><br></li>
|
||||
<li>Name: <a href="../../authors.html#Byron_Rakitzis">Byron Rakitzis</a><br>
|
||||
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
|
||||
<br><br></li>
|
||||
<li>Name: <a href="../../authors.html#Sean_Dorward">Sean Dorward</a><br>
|
||||
Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown
|
||||
location</em> <br><br></li>
|
||||
Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em>
|
||||
<br><br></li>
|
||||
</ul>
|
||||
|
||||
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
|
||||
@@ -144,35 +144,30 @@ location</em> <br><br></li>
|
||||
|
||||
<h2 id="to-build">To build:</h2>
|
||||
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> all</span></code></pre></div>
|
||||
<p>The authors provided another version of this program. See the <a
|
||||
href="#alternate-code">alternate version</a> section below.</p>
|
||||
<p>The authors provided another version of this program. See the <a href="#alternate-code">alternate
|
||||
version</a> section below.</p>
|
||||
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
|
||||
<p>The current status of this entry is:</p>
|
||||
<pre><code>STATUS: INABIAF - please **DO NOT** fix</code></pre>
|
||||
<p>For more detailed information see <a
|
||||
href="../../bugs.html#1990_tbr">1990 tbr bugs</a>.</p>
|
||||
<h3 id="a-note-about-the-fixes-of-this-entry-in-2023">A note about the
|
||||
fixes of this entry in 2023:</h3>
|
||||
<p>In 2023 it was noticed that in some systems like macOS there was
|
||||
confusing output due to a warning at runtime that was interspersed with
|
||||
the output of the program. For instance it would show:</p>
|
||||
<p>For more detailed information see <a href="../../bugs.html#1990_tbr">1990 tbr bugs</a>.</p>
|
||||
<h3 id="a-note-about-the-fixes-of-this-entry-in-2023">A note about the fixes of this entry in 2023:</h3>
|
||||
<p>In 2023 it was noticed that in some systems like macOS there was confusing
|
||||
output due to a warning at runtime that was interspersed with the output of the
|
||||
program. For instance it would show:</p>
|
||||
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./tbr</span></span>
|
||||
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> warning: this program uses gets<span class="er">(</span><span class="kw">)</span><span class="ex">,</span> which is unsafe.</span></code></pre></div>
|
||||
<p>which kind of hid the prompt. Thus the entry was changed to use
|
||||
<code>fgets(3)</code> which is referred to later in this file.</p>
|
||||
<p>Also <code>exit(3)</code> returns <code>void</code> but the entry was
|
||||
using it in a binary expression so this entry would not compile in
|
||||
modern systems. This fix is also referred to below, in the <a
|
||||
href="#alternate-code">alternate version</a> section.</p>
|
||||
<p>which kind of hid the prompt. Thus the entry was changed to use <code>fgets(3)</code> which
|
||||
is referred to later in this file.</p>
|
||||
<p>Also <code>exit(3)</code> returns <code>void</code> but the entry was using it in a binary expression so
|
||||
this entry would not compile in modern systems. This fix is also referred to
|
||||
below, in the <a href="#alternate-code">alternate version</a> section.</p>
|
||||
<h2 id="to-use">To use:</h2>
|
||||
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./tbr</span></span>
|
||||
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> enter some shell commands</span></code></pre></div>
|
||||
<p>NOTE: globs do not work with this entry. Why?</p>
|
||||
<p>NOTE: <code>exit</code> does not work and neither does
|
||||
<code>logout</code>. To exit try sending ctrl-d or ctrl-c (or kill it
|
||||
from another terminal :-) ). But why does it not work with just
|
||||
<code>exit</code> or <code>logout</code>? Hint: see the authors’
|
||||
remarks.</p>
|
||||
<p>NOTE: <code>exit</code> does not work and neither does <code>logout</code>. To exit try sending ctrl-d
|
||||
or ctrl-c (or kill it from another terminal :-) ). But why does it not work with
|
||||
just <code>exit</code> or <code>logout</code>? Hint: see the authors’ remarks.</p>
|
||||
<h2 id="try">Try:</h2>
|
||||
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./tbr</span></span>
|
||||
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> ls <span class="at">-l</span> tbr tbr.c</span>
|
||||
@@ -184,11 +179,10 @@ remarks.</p>
|
||||
<span id="cb5-8"><a href="#cb5-8" aria-hidden="true" tabindex="-1"></a><span class="fu">vi</span> tbr.c</span>
|
||||
<span id="cb5-9"><a href="#cb5-9" aria-hidden="true" tabindex="-1"></a></span>
|
||||
<span id="cb5-10"><a href="#cb5-10" aria-hidden="true" tabindex="-1"></a><span class="co"># then figure out how to exit vi :-)</span></span></code></pre></div>
|
||||
<p>What happens if you try using <code>cd -</code> to return to previous
|
||||
directory? What about <code>cd</code> with no args?</p>
|
||||
<p>The authors include a section called <a href="#bugs">BUGS</a> that,
|
||||
because they were documented, are not considered bugs as such in the
|
||||
context of the contest.</p>
|
||||
<p>What happens if you try using <code>cd -</code> to return to previous directory? What about
|
||||
<code>cd</code> with no args?</p>
|
||||
<p>The authors include a section called <a href="#bugs">BUGS</a> that, because they were
|
||||
documented, are not considered bugs as such in the context of the contest.</p>
|
||||
<h2 id="alternate-code">Alternate code:</h2>
|
||||
<p>The authors supplied us with a slightly smaller unformatted version
|
||||
of the program which we include below:</p>
|
||||
@@ -202,118 +196,91 @@ of the program which we include below:</p>
|
||||
<span id="cb6-8"><a href="#cb6-8" aria-hidden="true" tabindex="-1"></a><span class="dv">0</span><span class="op">),</span>e<span class="op">(</span>open<span class="op">(*</span>i<span class="op">,</span><span class="dv">0</span><span class="op">)):</span><span class="dv">5</span><span class="op">,</span>t<span class="op">?</span>dup2<span class="op">(</span>t<span class="op">,</span><span class="dv">1</span><span class="op">)</span>D t<span class="op">):</span>i<span class="op">[</span><span class="dv">2</span><span class="op">]?</span><span class="dv">9</span> D</span>
|
||||
<span id="cb6-9"><a href="#cb6-9" aria-hidden="true" tabindex="-1"></a><span class="dv">1</span><span class="op">),</span>e<span class="op">(</span>creat<span class="op">(</span>i<span class="op">[</span><span class="dv">2</span><span class="op">],</span><span class="dv">438</span><span class="op">)):</span><span class="dv">2</span><span class="op">,</span>e<span class="op">(</span>execvp<span class="op">(*</span>u<span class="op">,</span>u<span class="op">))):</span>e<span class="op">(</span>chdir<span class="op">(</span>u<span class="op">[</span><span class="dv">1</span><span class="op">])*</span><span class="dv">2</span><span class="op">):</span><span class="dv">6</span><span class="op">;}</span></span>
|
||||
<span id="cb6-10"><a href="#cb6-10" aria-hidden="true" tabindex="-1"></a>e<span class="op">(</span>x<span class="op">){</span>x<span class="op"><</span><span class="dv">0</span><span class="op">?</span>write<span class="op">(</span><span class="dv">2</span><span class="op">,</span><span class="st">"?</span><span class="sc">\n</span><span class="st">$ "</span><span class="op">-</span>x<span class="op">/</span><span class="dv">4</span><span class="op">,</span><span class="dv">2</span><span class="op">),</span>x<span class="op">+</span><span class="dv">1</span><span class="op">||(</span>exit<span class="op">(</span><span class="dv">1</span><span class="op">),</span><span class="dv">0</span><span class="op">):</span><span class="dv">5</span><span class="op">;}</span></span></code></pre></div>
|
||||
<p>and in the <a href="tbr.alt.c">alternate source</a>. It has the
|
||||
<code>exit()</code> returns <code>void</code> fix as well as the
|
||||
<code>gets()</code> to <code>fgets()</code> fix applied to it to make it
|
||||
functionally equivalent like the authors intended.</p>
|
||||
<p>and in the <a href="tbr.alt.c">alternate source</a>. It has the <code>exit()</code> returns <code>void</code> fix
|
||||
as well as the <code>gets()</code> to <code>fgets()</code> fix applied to it to make it functionally
|
||||
equivalent like the authors intended.</p>
|
||||
<h3 id="alternate-build">Alternate build:</h3>
|
||||
<div class="sourceCode" id="cb7"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> alt</span></code></pre></div>
|
||||
<h3 id="alternate-use">Alternate use:</h3>
|
||||
<div class="sourceCode" id="cb8"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./tbr.alt</span></span></code></pre></div>
|
||||
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
||||
<p>This program touches on a well known Unix utility, the 6th edition
|
||||
Bourne Shell (<code>/bin/sh</code>), whose original source was
|
||||
considered to be extremely obfuscated by many people (although Steve
|
||||
Bourne might disagree). Did you know that the Bourne Shell source was a
|
||||
major inspiration for the formation of the IOCCC back in 1984?</p>
|
||||
<p>This program touches on a well known Unix utility, the 6th edition Bourne Shell
|
||||
(<code>/bin/sh</code>), whose original source was considered to be extremely obfuscated by
|
||||
many people (although Steve Bourne might disagree). Did you know that the Bourne
|
||||
Shell source was a major inspiration for the formation of the IOCCC back in
|
||||
1984?</p>
|
||||
<h2 id="authors-remarks">Authors’ remarks:</h2>
|
||||
<p>This program is a rudimentary shell. It does I/O redirection, pipes
|
||||
and cd. It flags errors on failed <code>chdir()</code>,
|
||||
<code>open()</code>, <code>creat()</code>, <code>execvp()</code>,
|
||||
<code>fork()</code> and a few syntax errors.</p>
|
||||
<p>This program is obfuscated in a few notable ways: apart from the
|
||||
layout (an unformatted (but crunched) version is included for people who
|
||||
want to put this through <code>cb</code>) it makes clever use of a
|
||||
<code>write()</code> statement, so that the same statement can be used
|
||||
to print errors and the prompt. By calling the error function with the
|
||||
value <code>-8</code>, the pointer offset in the expression
|
||||
<code>"?\n$ "-x/4</code> goes from 0 to 2. Presto! A prompt. For errors
|
||||
with numbers smaller than <code>-4</code> (i.e., UNIX system calls) a
|
||||
question mark is printed.</p>
|
||||
<p>The error value of <code>chdir()</code> is doubled so that we don’t
|
||||
exit from the parent shell on a <code>chdir()</code> error (since
|
||||
<code>e()</code> exits on <code>-1</code> errors only). All other system
|
||||
call failures exit since they are from sub-shells.</p>
|
||||
<p>Recursion is sneakily employed to avoid a second call to
|
||||
<code>fork()</code>, and the line is parsed in a fairly bizarre fashion:
|
||||
backwards. The heart of the program, that is, the part which performs
|
||||
all <code>fork()</code>s, <code>exec()</code>s, <code>open()</code>s,
|
||||
etc. is ONE C STATEMENT.</p>
|
||||
and cd. It flags errors on failed <code>chdir()</code>, <code>open()</code>, <code>creat()</code>,
|
||||
<code>execvp()</code>, <code>fork()</code> and a few syntax errors.</p>
|
||||
<p>This program is obfuscated in a few notable ways: apart from the layout (an
|
||||
unformatted (but crunched) version is included for people who want to put this
|
||||
through <code>cb</code>) it makes clever use of a <code>write()</code> statement, so that the same statement
|
||||
can be used to print errors and the prompt. By calling the error function with
|
||||
the value <code>-8</code>, the pointer offset in the expression <code>"?\n$ "-x/4</code> goes from 0
|
||||
to 2. Presto! A prompt. For errors with numbers smaller than <code>-4</code> (i.e., UNIX
|
||||
system calls) a question mark is printed.</p>
|
||||
<p>The error value of <code>chdir()</code> is doubled so that we don’t exit from the parent
|
||||
shell on a <code>chdir()</code> error (since <code>e()</code> exits on <code>-1</code> errors only). All other
|
||||
system call failures exit since they are from sub-shells.</p>
|
||||
<p>Recursion is sneakily employed to avoid a second call to <code>fork()</code>,
|
||||
and the line is parsed in a fairly bizarre fashion: backwards. The
|
||||
heart of the program, that is, the part which performs all <code>fork()</code>s,
|
||||
<code>exec()</code>s, <code>open()</code>s, etc. is ONE C STATEMENT.</p>
|
||||
<p>The meta-values array is initialized in a bizarre fashion, and the
|
||||
subsequent checks for the <code>'<'</code> and <code>'>'</code>
|
||||
are performed in a single statement using a mask, since you know that
|
||||
<code>'>'&2</code> is 0, whereas <code>'<'&2</code> is 2.
|
||||
Other such micro-obfuscations abound.</p>
|
||||
subsequent checks for the <code>'<'</code> and <code>'>'</code> are performed in a single
|
||||
statement using a mask, since you know that <code>'>'&2</code> is 0, whereas
|
||||
<code>'<'&2</code> is 2. Other such micro-obfuscations abound.</p>
|
||||
<p>Finally, it is notable that the code was hacked for minimality. If
|
||||
you look at the compressed version, you will be hard-pressed to
|
||||
eliminate more than a few characters (we can’t see how to make it any
|
||||
smaller!). 550 characters is pretty lean for a shell that does this
|
||||
much.</p>
|
||||
eliminate more than a few characters (we can’t see how to make it
|
||||
any smaller!). 550 characters is pretty lean for a shell that does
|
||||
this much.</p>
|
||||
<h3 id="bugs">BUGS</h3>
|
||||
<p>The syntax of the shell has not been fully explored, but if you try
|
||||
to redirect in the same direction more than once, only one redirection
|
||||
is performed. This is a “feature” of the way the line is parsed; a
|
||||
pointer to the stack of arguments is assigned and an argument is stolen
|
||||
every time a <code>></code> or <code><</code> is encountered. The
|
||||
to redirect in the same direction more than once, only one
|
||||
redirection is performed. This is a “feature” of the way the line
|
||||
is parsed; a pointer to the stack of arguments is assigned and an
|
||||
argument is stolen every time a <code>></code> or <code><</code> is encountered. The
|
||||
shell flags an error if no arguments are on the stack. Thus, for
|
||||
example:</p>
|
||||
<div class="sourceCode" id="cb9"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cat</span> <span class="op">></span> foo <span class="op">></span> bar</span></code></pre></div>
|
||||
<p>cats to <code>foo</code>, since it was pushed last, but</p>
|
||||
<div class="sourceCode" id="cb10"><pre
|
||||
class="sourceCode sh"><code class="sourceCode bash"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cat</span> <span class="op">></span> <span class="op">></span> foo bar</span></code></pre></div>
|
||||
<p>cats to <code>bar</code>, since <code>bar</code> was pushed under
|
||||
<code>foo</code> (remember we’re parsing right-left).</p>
|
||||
<p>Depending on your flavor of Unix, <code>cd</code> without an argument
|
||||
will either produce an error or just do nothing.</p>
|
||||
<div class="sourceCode" id="cb10"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cat</span> <span class="op">></span> <span class="op">></span> foo bar</span></code></pre></div>
|
||||
<p>cats to <code>bar</code>, since <code>bar</code> was pushed under <code>foo</code> (remember we’re
|
||||
parsing right-left).</p>
|
||||
<p>Depending on your flavor of Unix, <code>cd</code> without an argument will
|
||||
either produce an error or just do nothing.</p>
|
||||
<p>There is just one error message, the question mark, but hey, that’s
|
||||
all <code>ed(1)</code> does too.</p>
|
||||
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
|
||||
License:</h2>
|
||||
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
|
||||
Reserved. You are free to share and adapt this file under the terms of
|
||||
this license:</p>
|
||||
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0 License:</h2>
|
||||
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights Reserved.
|
||||
You are free to share and adapt this file under the terms of this license:</p>
|
||||
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
|
||||
<p>For more information, see:
|
||||
https://creativecommons.org/licenses/by-sa/4.0/</p>
|
||||
<p>For more information, see: https://creativecommons.org/licenses/by-sa/4.0/</p>
|
||||
|
||||
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
|
||||
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
|
||||
|
||||
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
|
||||
|
||||
<h1 id="inventory-for-1990tbr"><a name="inventory"></a>Inventory for
|
||||
1990/tbr</h1>
|
||||
<h1 id="inventory-for-1990tbr"><a name="inventory"></a>Inventory for 1990/tbr</h1>
|
||||
<p><a href="#top">Jump to top</a></p>
|
||||
<h2 id="primary-files">Primary files</h2>
|
||||
<ul>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1990/tbr/tbr.c">tbr.c</a>
|
||||
- entry source</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1990/tbr/Makefile">Makefile</a>
|
||||
- entry Makefile</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1990/tbr/tbr.alt.c">tbr.alt.c</a>
|
||||
- alternative source</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1990/tbr/tbr.orig.c">tbr.orig.c</a>
|
||||
- original source</li>
|
||||
<li><a href="1990_tbr.tar.bz2">1990_tbr.tar.bz2</a> - download entry
|
||||
source</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1990/tbr/tbr.c">tbr.c</a> - entry source</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1990/tbr/Makefile">Makefile</a> - entry Makefile</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1990/tbr/tbr.alt.c">tbr.alt.c</a> - alternative source</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1990/tbr/tbr.orig.c">tbr.orig.c</a> - original source</li>
|
||||
<li><a href="1990_tbr.tar.bz2">1990_tbr.tar.bz2</a> - download entry source</li>
|
||||
</ul>
|
||||
<h2 id="secondary-files">Secondary files</h2>
|
||||
<ul>
|
||||
<li><a href="index.html">index.html</a> - entry home page</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1990/tbr/.entry.json">.entry.json</a>
|
||||
- description of entry in JSON</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1990/tbr/.gitignore">.gitignore</a>
|
||||
- list of files that should not be committed under git</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1990/tbr/.entry.json">.entry.json</a> - description of entry in JSON</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1990/tbr/.gitignore">.gitignore</a> - list of files that should not be committed under git</li>
|
||||
<li><a href=".path">.path</a> - directory path from top directory</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1990/tbr/README.md">README.md</a>
|
||||
- markdown source for index.html</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1990/tbr/README.md">README.md</a> - markdown source for index.html</li>
|
||||
</ul>
|
||||
|
||||
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->
|
||||
|
||||
Reference in new issue
Block a user