From 45fb924ecfb5212f04f548e73a100607eae17ef9 Mon Sep 17 00:00:00 2001
From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com>
Date: Thu, 31 Oct 2024 06:14:58 -0700
Subject: [PATCH] Add missing 1994/shapiro/shapiro.alt.c
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
With a tip from Leo the missing alt code has been added to the website.
Ta, Leo (š¦āļøš)!
---
1994/shapiro/.entry.json | 8 ++++++
1994/shapiro/Makefile | 8 ++++--
1994/shapiro/README.md | 25 ++++++++++++++---
1994/shapiro/index.html | 15 +++++++---
1994/shapiro/shapiro.alt.c | 57 ++++++++++++++++++++++++++++++++++++++
bugs.html | 7 +----
bugs.md | 8 ------
thanks-for-help.html | 3 ++
thanks-for-help.md | 4 +++
9 files changed, 111 insertions(+), 24 deletions(-)
create mode 100644 1994/shapiro/shapiro.alt.c
diff --git a/1994/shapiro/.entry.json b/1994/shapiro/.entry.json
index 8de4454f9..b5fad5101 100644
--- a/1994/shapiro/.entry.json
+++ b/1994/shapiro/.entry.json
@@ -45,6 +45,14 @@
"display_via_github" : false,
"entry_text" : "author's hints"
},
+ {
+ "file_path" : "shapiro.alt.c",
+ "inventory_order" : 150,
+ "OK_to_edit" : true,
+ "display_as" : "c",
+ "display_via_github" : true,
+ "entry_text" : "author provided unobfuscated and formatted source code"
+ },
{
"file_path" : "1994_shapiro.tar.bz2",
"inventory_order" : 1415926535,
diff --git a/1994/shapiro/Makefile b/1994/shapiro/Makefile
index cc50c9060..f2deafd79 100644
--- a/1994/shapiro/Makefile
+++ b/1994/shapiro/Makefile
@@ -118,8 +118,8 @@ OBJ= ${PROG}.o
DATA= shapiro.md
TARGET= ${PROG}
#
-ALT_OBJ=
-ALT_TARGET=
+ALT_OBJ= ${PROG}.alt.o
+ALT_TARGET= ${PROG}.alt
#################
@@ -146,6 +146,10 @@ ${PROG}_t1: ${PROG}.c
alt: data ${ALT_TARGET}
@${TRUE}
+
+${PROG}.alt: ${PROG}.alt.c
+ ${CC} ${CFLAGS} $< -o $@ ${LDFLAGS}
+
# data files
#
data: ${DATA}
diff --git a/1994/shapiro/README.md b/1994/shapiro/README.md
index 45e3a4701..ff5e61429 100644
--- a/1994/shapiro/README.md
+++ b/1994/shapiro/README.md
@@ -4,13 +4,15 @@
make all
```
+There is an alternate version that is unobfuscated, provided by the author. See
+[Alternate code](#alternate-code) below.
+
### Bugs and (Mis)features:
The current status of this entry is:
> **STATUS: INABIAF - please DO NOT fix** There is an alternate version that is unobfuscated, provided by the author. See
+Alternate code below. The current status of this entry is: STATUS: INABIAF - please DO NOT fix STATUS: INABIAF - please DO NOT fix For more detailed information see 1994/shapiro in bugs.html. Notice what you see in the output of This version, shapiro.alt.c, is an
+unobfuscated version provided by the author. Use This entry has many different levels of obfuscation, and yet the
source file is self documenting. :-) From time to time, run If you want more information on the internals of this program, see
shapiro.html. The missing file The basic theme (pun) of this program is:
-> **STATUS: missing file - please provide it**
For more detailed information see [1994/shapiro in bugs.html](../../bugs.html#1994_shapiro).
@@ -41,6 +43,24 @@ Notice what you see in the output of `ps`! Observe too what happens after you
bring it back to the foreground.
+## Alternate code:
+
+This version, [shapiro.alt.c](%%REPO_URL%%/1994/shapiro/shapiro.alt.c), is an
+unobfuscated version provided by the author.
+
+
+## Alternate build:
+
+```
+ make alt
+```
+
+
+### Alternate use:
+
+Use `shapiro.alt` as you would `shapiro` above.
+
+
## Judges' remarks:
This entry has many different levels of obfuscation, and yet the
@@ -51,9 +71,6 @@ From time to time, run `ps(1)` and look at the new processes.
If you want more information on the internals of this program, see
[shapiro.html](shapiro.html).
-The missing file `shapiro.alt.c` is an unobfuscated version of this program. See
-[1994/shapiro in bugs.html](../../bugs.html#1994_shapiro).
-
## Author's remarks:
diff --git a/1994/shapiro/index.html b/1994/shapiro/index.html
index a04b401d8..85c650d09 100644
--- a/1994/shapiro/index.html
+++ b/1994/shapiro/index.html
@@ -446,11 +446,12 @@ Location: US - United States of America
To build:
+ make allBugs and (Mis)features:
-
-STATUS: missing file - please provide itTo use:
@@ -467,14 +468,19 @@ Location: US - United States of America
./shapiro_t1
ps! Observe too what happens after you
bring it back to the foreground.Alternate code:
+Alternate build:
+
+ make altAlternate use:
+shapiro.alt as you would shapiro above.Judgesā remarks:
ps(1) and look at the new processes.shapiro.alt.c is an unobfuscated version of this program. See
-1994/shapiro in bugs.html.Authorās remarks:
@@ -535,6 +541,7 @@ test it on.)
EOF != -1!= EOF.
Since it works there is no need to fix this except for a challenge to yourself.
Jump to: top
-The index.html file refers to an alternate version of the code that is not -obfuscated but it is missing from the entry directory and the archive. Do you -have this file?
-Jump to: top
Jump to: top
-The authors stated that they included a version that allows people with just K&R diff --git a/bugs.md b/bugs.md index 1abbc8540..4d2da277a 100644 --- a/bugs.md +++ b/bugs.md @@ -1702,14 +1702,6 @@ Since it works there is no need to fix this except for a challenge to yourself. Jump to: [top](#) -### STATUS: missing file - please provide it - -The index.html file refers to an alternate version of the code that is not -obfuscated but it is missing from the entry directory and the archive. Do you -have this file? - -Jump to: [top](#) -
getc() will return -1 on EOF or error, no
where EOF != -1 it could result in an infinite loop.
For an interesting problem that occurred here and what was done to solve it, check 1994/shapiro in bugs.html.
+Cody also provided the missing +shapiro.alt.c file, found by Leo. +Thanks Leo!
Jump to: top