Move 199[1-3]/ant and 2015/howe alt code
The unobfuscated code, which was put in deobfuscated/, has been turned into alt code. In one case the already existing alt code was made alt2 and the unobfuscated code was alt. In the case of the ones with two C files there, the one that did not require modification (to compile in modern systems) were used as those are original. In a few cases these changes suggested additional files: a test suite Makefile for the alt code, a try.alt.sh script and maybe some other things besides. The bug status was updated for 2015/howe with a known bug: in particular the test scripts do not work (at least not completely). In the manifest all references (except for a file name that has not been renamed - at least not yet) of 'deobfuscated' to 'unobfuscated': a minor detail that might not matter much but it sounds ever so slightly better (maybe). These other entries that had an entry_text change were 1995/garry and 2020/endoh2. Rebuilt .entry.json and index.html files for this (and in the case of the moved code the index.html files also had to be changed for that in addition to the Makefiles).
This commit is contained in:
1 parent
c9ca6b4150
commit
92139c55d7
53 files changed
+993
-1740
No files matched your search
+6
-22
@@ -50,20 +50,12 @@
|
||||
"entry_text" : "script to try entry"
|
||||
},
|
||||
{
|
||||
"file_path" : "deobfuscated/ant-c89.c",
|
||||
"file_path" : "ant.alt.c",
|
||||
"inventory_order" : 120,
|
||||
"OK_to_edit" : true,
|
||||
"display_as" : "c",
|
||||
"display_via_github" : true,
|
||||
"entry_text" : "author provided deobfuscated code converted from K&R"
|
||||
},
|
||||
{
|
||||
"file_path" : "deobfuscated/ant.c",
|
||||
"inventory_order" : 120,
|
||||
"OK_to_edit" : true,
|
||||
"display_as" : "c",
|
||||
"display_via_github" : true,
|
||||
"entry_text" : "author provided deobfuscated code"
|
||||
"entry_text" : "author provided unobfuscated code"
|
||||
},
|
||||
{
|
||||
"file_path" : "try.alt.sh",
|
||||
@@ -71,23 +63,15 @@
|
||||
"OK_to_edit" : true,
|
||||
"display_as" : "shellscript",
|
||||
"display_via_github" : true,
|
||||
"entry_text" : "script to try deobfuscated code"
|
||||
"entry_text" : "script to try unobfuscated code"
|
||||
},
|
||||
{
|
||||
"file_path" : "deobfuscated/Makefile",
|
||||
"file_path" : "test.alt.mk",
|
||||
"inventory_order" : 140,
|
||||
"OK_to_edit" : true,
|
||||
"display_as" : "makefile",
|
||||
"display_via_github" : true,
|
||||
"entry_text" : "author provided Makefile for deobfuscated code"
|
||||
},
|
||||
{
|
||||
"file_path" : "deobfuscated/test.mk",
|
||||
"inventory_order" : 140,
|
||||
"OK_to_edit" : true,
|
||||
"display_as" : "makefile",
|
||||
"display_via_github" : true,
|
||||
"entry_text" : "author provided test suite Makefile for deobfuscated code"
|
||||
"entry_text" : "author provided test suite Makefile for unobfuscated code"
|
||||
},
|
||||
{
|
||||
"file_path" : "ant.test.mk",
|
||||
@@ -111,7 +95,7 @@
|
||||
"OK_to_edit" : true,
|
||||
"display_as" : "makefile",
|
||||
"display_via_github" : true,
|
||||
"entry_text" : "test suite Makefile for deobfuscated code"
|
||||
"entry_text" : "test suite Makefile for unobfuscated code"
|
||||
},
|
||||
{
|
||||
"file_path" : "1993_ant.tar.bz2",
|
||||
|
||||
+4
-18
@@ -116,8 +116,8 @@ OBJ= ${PROG}.o
|
||||
DATA=
|
||||
TARGET= ${PROG}
|
||||
#
|
||||
ALT_OBJ= deobfuscated/${PROG}.o
|
||||
ALT_TARGET= deobfuscated/${PROG}
|
||||
ALT_OBJ= ${PROG}.alt.o
|
||||
ALT_TARGET= ${PROG}.alt
|
||||
|
||||
|
||||
#################
|
||||
@@ -148,22 +148,8 @@ ag.txt: ${PROG}.txt
|
||||
alt: data ${PROG}.alt
|
||||
@${TRUE}
|
||||
|
||||
# We keep the alternate code, the deobfuscated code, and its Makefile, in the
|
||||
# deobfuscated directory but copy the compiled binaries to the entry directory,
|
||||
# to keep both directories clean, separating the two. The reason we copy the
|
||||
# binary to the entry directory is so one does not have to do:
|
||||
#
|
||||
# ./deobfuscated/ant
|
||||
#
|
||||
# but instead just:
|
||||
#
|
||||
# ./ant.alt
|
||||
#
|
||||
# while still using the Makefile provided with the deobfuscated code.
|
||||
#
|
||||
${PROG}.alt: deobfuscated/ant.c
|
||||
${MAKE} -C deobfuscated ant
|
||||
${CP} -v -f deobfuscated/ant ant.alt
|
||||
${PROG}.alt: ant.alt.c
|
||||
${CC} ${CFLAGS} $< -o $@ ${LDFLAGS}
|
||||
|
||||
ag.alt: ${PROG}.alt
|
||||
${RM} -f $@
|
||||
|
||||
+3
-3
@@ -4,7 +4,7 @@
|
||||
make all
|
||||
```
|
||||
|
||||
The author provided a deobfuscated version. See [Alternate
|
||||
The author provided an unobfuscated version. See [Alternate
|
||||
code](#alternate-code) below.
|
||||
|
||||
|
||||
@@ -36,8 +36,8 @@ For more detailed information see [1993/ant in bugs.html](../../bugs.html#1993_a
|
||||
|
||||
## Alternate code:
|
||||
|
||||
The [ant.c in deobfuscated/](%%REPO_URL%%/1993/ant/deobfuscated/ant.c) is a
|
||||
deobfuscated version provided by the author. You can look at this code if you
|
||||
The [ant.alt.c](%%REPO_URL%%/1993/ant/ant.alt.c) is an
|
||||
unobfuscated version provided by the author. You can look at this code if you
|
||||
want some clues in how it works.
|
||||
|
||||
|
||||
|
||||
File renamed without changes.
@@ -10,7 +10,7 @@ PRG=./ant.alt
|
||||
all: ant.alt char word anchor literal wild closure option branch sub class
|
||||
|
||||
#
|
||||
# Built the entry
|
||||
# Build the entry
|
||||
#
|
||||
ant.alt: Makefile
|
||||
make -f Makefile ant.alt
|
||||
|
||||
@@ -10,7 +10,7 @@ PRG=./ant
|
||||
all: ant char word anchor literal wild closure option branch sub class
|
||||
|
||||
#
|
||||
# Built the entry
|
||||
# Build the entry
|
||||
#
|
||||
ant: Makefile
|
||||
make -f Makefile ant
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
CFLAGS= -Os -Wno-deprecated-non-prototype
|
||||
|
||||
all: build
|
||||
|
||||
build: ant ant-c89
|
||||
|
||||
clean:
|
||||
-rm -f ant ant-c89 *.out
|
||||
|
||||
# Original K&R version.
|
||||
ant$E: ant.c
|
||||
${CC} ${CFLAGS} ant.c -o $@
|
||||
|
||||
ant-c89$E: ant-c89.c
|
||||
${CC} ${CFLAGS} ant-c89.c -o $@
|
||||
|
||||
test: ant$E
|
||||
${MAKE} -f test.mk PRG=./ant >ant.out 2>&1
|
||||
|
||||
test-c89: ant-c89$E
|
||||
${MAKE} -f test.mk PRG=./ant-c89 >ant-c89.out 2>&1
|
||||
|
||||
# Make sure the old and revised versions behave the same.
|
||||
test-compare: build test test-c89
|
||||
sed -e 's/-c89//' ant-c89.out | diff -u ant.out -
|
||||
rm *.out
|
||||
|
||||
@@ -1,449 +0,0 @@
|
||||
/*
|
||||
* ag.c
|
||||
*
|
||||
* Anthony's Grep
|
||||
*
|
||||
* Public Domain 1992, 1993 by Anthony Howe. All rights released.
|
||||
*
|
||||
* Synopsis: ag <pattern> [files...]
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifndef ARRAY
|
||||
#define ARRAY 512
|
||||
#endif
|
||||
|
||||
#define EXIT_MATCH 0
|
||||
#define EXIT_NOMATCH 1
|
||||
#define EXIT_USAGE 2
|
||||
#define EXIT_ERROR 3
|
||||
|
||||
/*
|
||||
* Non-deterministic Finite-state Automaton
|
||||
*
|
||||
* An NFA is a directed graph whose nodes are called states. Each
|
||||
* state is either a labeled state denoting a literal value, or a
|
||||
* NIL state that has no label. Each state has at most two edges
|
||||
* leaving it. There is only one start state and one final state,
|
||||
* which may be the same state.
|
||||
*
|
||||
* Various state-structures can be represented by an array. These
|
||||
* structures have only one start point being the left most index,
|
||||
* and one end point being the right most index.
|
||||
*
|
||||
* a ...[a]...
|
||||
*
|
||||
* ab ...[a][b]...
|
||||
*
|
||||
* ^a [bol][a]...
|
||||
*
|
||||
* a$ ...[a][eol]
|
||||
*
|
||||
* a.b ...[a][wild][b]...
|
||||
* _
|
||||
* v \
|
||||
* a* ...[\][a][\]...
|
||||
* \____^
|
||||
*
|
||||
* a? ...[\][a]...
|
||||
* \___^
|
||||
* _______________
|
||||
* / v
|
||||
* a|b ...[\][a][/][stop][pass][b]...
|
||||
* \_____________^
|
||||
*
|
||||
* [a0-9] ...[class][a][0][1][2][3][4][5][6][7][8][9][stop]...
|
||||
*
|
||||
* [^a0-9] ...[nclass][a][0][1][2][3][4][5][6][7][8][9][stop]...
|
||||
*
|
||||
* _____________ _______________
|
||||
* / v/ v
|
||||
* a|b|c ...[\][a][/][stop][\][b][/][stop][pass][c]...
|
||||
* \_____________^\_____________^
|
||||
*
|
||||
* _ _______________
|
||||
* v \ / v
|
||||
* a*(b|c) ...[\][a][\][\][b][/][stop][pass][c]...
|
||||
* \____^ \_____________^
|
||||
*/
|
||||
|
||||
#define BOL ('\n')
|
||||
#define EOL ('\n')
|
||||
#define STOP ('\n')
|
||||
#define WILD (0)
|
||||
#define CLASS (-1)
|
||||
#define NCLASS (-2)
|
||||
#define PASS (-3)
|
||||
#define JUMP(n) (-4-(n))
|
||||
#define CHAR(c) (c)
|
||||
#define ISJUMP(x) ((x) <= PASS)
|
||||
#define ISCHAR(x) (0 <= (x))
|
||||
|
||||
/*
|
||||
* Special member that is contained in all sets. It is the location
|
||||
* of the WILD element that the pattern array is initialised with in
|
||||
* main(). Due to the way from() performs the pattern search, this
|
||||
* member is always the first member of a set and so can be used to
|
||||
* delimit sets.
|
||||
*/
|
||||
#define MEMBER 2
|
||||
|
||||
typedef int I;
|
||||
typedef char C;
|
||||
typedef void V;
|
||||
|
||||
I chr;
|
||||
I final;
|
||||
I nesting;
|
||||
I array[ARRAY], next;
|
||||
|
||||
/*
|
||||
* The number of states will always be related to the number of
|
||||
* unique sets in set[], which is less-than-equal-to next_set.
|
||||
* There is no need to bounds check dfa[][] since next_set
|
||||
* is bounds checked in from() and would cause an error well in
|
||||
* advance of overflowing the total number of possible states.
|
||||
*/
|
||||
I dfa[ARRAY][ARRAY];
|
||||
I set[ARRAY], new_set, next_set;
|
||||
|
||||
I new();
|
||||
I match();
|
||||
I inclass();
|
||||
I isfinal();
|
||||
V expr();
|
||||
V term();
|
||||
V factor();
|
||||
V literal();
|
||||
V from();
|
||||
|
||||
I
|
||||
main(argc, argv)
|
||||
I argc;
|
||||
C **argv;
|
||||
{
|
||||
I error;
|
||||
FILE *file;
|
||||
C *name, line[BUFSIZ+1];
|
||||
|
||||
if (--argc < 1) {
|
||||
fprintf(stderr, "usage: ag <pattern> [files...]\n");
|
||||
return (EXIT_USAGE);
|
||||
}
|
||||
|
||||
/* Initialise array[] = [pass][3][wild][1]... */
|
||||
new(PASS);
|
||||
new(JUMP(next+2));
|
||||
new(WILD);
|
||||
new(JUMP(next-1));
|
||||
|
||||
expr(&(*++argv));
|
||||
|
||||
*line = BOL;
|
||||
next_set = 1;
|
||||
error = EXIT_NOMATCH;
|
||||
do {
|
||||
name = "-";
|
||||
file = stdin;
|
||||
if (1 < argc && **++argv != '-') {
|
||||
if (NULL == (file = fopen(name = *argv, "r"))) {
|
||||
fprintf(stderr,
|
||||
"ag: Failed to open '%s'.\n", name);
|
||||
error = EXIT_ERROR;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
while (fgets(line+1, BUFSIZ, file) != NULL) {
|
||||
if (match(line)) {
|
||||
printf("%s:%s", name, line+1);
|
||||
error = EXIT_MATCH;
|
||||
}
|
||||
}
|
||||
fclose(file);
|
||||
} while (1 < --argc);
|
||||
return (error);
|
||||
}
|
||||
|
||||
/*
|
||||
* expr
|
||||
* term
|
||||
* expr | term
|
||||
*/
|
||||
V
|
||||
expr(p)
|
||||
C **p;
|
||||
{
|
||||
I i, j;
|
||||
i = new(PASS);
|
||||
term(p);
|
||||
while (**p == '|') {
|
||||
++*p;
|
||||
j = new(PASS);
|
||||
new(STOP);
|
||||
array[i] = JUMP(next);
|
||||
i = new(PASS);
|
||||
term(p);
|
||||
array[j] = JUMP(next);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* term
|
||||
* factor
|
||||
* term factor
|
||||
*/
|
||||
V
|
||||
term(p)
|
||||
C **p;
|
||||
{
|
||||
while (**p != '|' && (0 == nesting || **p != ')') && **p != '\0')
|
||||
factor(p);
|
||||
}
|
||||
|
||||
/*
|
||||
* factor
|
||||
* ^
|
||||
* $
|
||||
* literal
|
||||
* ( expr )
|
||||
* factor *
|
||||
*/
|
||||
V
|
||||
factor(p)
|
||||
C **p;
|
||||
{
|
||||
I i = new(PASS);
|
||||
if (**p == '^') {
|
||||
++*p;
|
||||
new(BOL);
|
||||
} else if (**p == '$') {
|
||||
++*p;
|
||||
new(EOL);
|
||||
} else if (**p == '(') {
|
||||
++*p;
|
||||
++nesting;
|
||||
expr(p);
|
||||
if (**p != ')') {
|
||||
fprintf(stderr, "ag: Missing ')'.\n");
|
||||
exit(EXIT_ERROR);
|
||||
}
|
||||
--nesting;
|
||||
++*p;
|
||||
} else {
|
||||
literal(p);
|
||||
}
|
||||
if (**p == '*') {
|
||||
++*p;
|
||||
array[i] = JUMP(next);
|
||||
new(JUMP(i+1));
|
||||
} else if (**p == '?') {
|
||||
++*p;
|
||||
array[i] = JUMP(next);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* literal
|
||||
* .
|
||||
* class
|
||||
* character
|
||||
* \ character
|
||||
*
|
||||
* class
|
||||
* [ ] ]
|
||||
* [ range ]
|
||||
* [ ] range ]
|
||||
* [ ^ range ]
|
||||
* [ ^ ] range ]
|
||||
*
|
||||
* range
|
||||
* -
|
||||
* character
|
||||
* range character
|
||||
* character_low - character_hi
|
||||
* range character_low - character_hi
|
||||
*/
|
||||
V
|
||||
literal(p)
|
||||
C **p;
|
||||
{
|
||||
I i, j;
|
||||
if (**p == '.') {
|
||||
new(WILD);
|
||||
} else if (**p == '[') {
|
||||
++*p;
|
||||
i = new(CLASS);
|
||||
if (**p == '^') {
|
||||
++*p;
|
||||
array[i] = NCLASS;
|
||||
}
|
||||
if (**p == ']') {
|
||||
++*p;
|
||||
new(CHAR(']'));
|
||||
}
|
||||
while ((i = **p) != ']') {
|
||||
if ((*p)[1] == '-' && i < (j = (*p)[2])) {
|
||||
while (i <= j)
|
||||
new(CHAR(i++));
|
||||
*p += 3;
|
||||
} else {
|
||||
new(CHAR(i));
|
||||
++*p;
|
||||
}
|
||||
}
|
||||
new(STOP);
|
||||
} else {
|
||||
if (**p == '\\')
|
||||
++*p;
|
||||
new(CHAR(**p));
|
||||
}
|
||||
++*p;
|
||||
}
|
||||
|
||||
/*
|
||||
* Allocate an element from the pool of free elements. The
|
||||
* global variable 'next' points to the next free element in
|
||||
* the pool. Return the allocated element's index.
|
||||
*/
|
||||
I
|
||||
new(c)
|
||||
I c;
|
||||
{
|
||||
if (ARRAY <= next) {
|
||||
fprintf(stderr, "ag: Pattern too long.\n");
|
||||
exit(EXIT_ERROR);
|
||||
}
|
||||
array[next] = c;
|
||||
return (next++);
|
||||
}
|
||||
|
||||
/*
|
||||
* Find all labeled elements reachable from element 'p' and add to
|
||||
* the global set 'new_set' those that are labeled with global 'chr'.
|
||||
* 'final' is true if the final state can be reached.
|
||||
*/
|
||||
V
|
||||
from(p)
|
||||
I p;
|
||||
{
|
||||
I i = new_set;
|
||||
if (next <= p)
|
||||
return;
|
||||
if (ISJUMP(array[p])) {
|
||||
if (array[p] != PASS)
|
||||
from(JUMP(array[p]));
|
||||
from(p+1);
|
||||
} else if (WILD == array[p] || array[p] == CHAR(chr) || inclass(&p)) {
|
||||
/* If element 'p' already a member of set 't' then return. */
|
||||
while (i < next_set)
|
||||
if (set[i++] == p)
|
||||
return;
|
||||
/* Can we reach the final state from here? */
|
||||
final = isfinal(p+1);
|
||||
|
||||
if (ARRAY <= next_set) {
|
||||
fprintf(stderr, "ag: Out of space.\n");
|
||||
exit(EXIT_ERROR);
|
||||
}
|
||||
/* Add element 'p' to set 't'. */
|
||||
set[next_set++] = p;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* If element pointed to by 'p' is CLASS, return true if 'c' is in
|
||||
* the class. If the element is NCLASS, return true if 'c' is not
|
||||
* in the class. Pass back the end of the character class in 'p'.
|
||||
*/
|
||||
I
|
||||
inclass(p)
|
||||
I *p;
|
||||
{
|
||||
I i = 0, j = 0;
|
||||
if (array[*p] == CLASS || (j = array[*p] == NCLASS)) {
|
||||
while (array[++*p] != STOP)
|
||||
if (array[*p] == CHAR(chr))
|
||||
i = 1;
|
||||
}
|
||||
return (i ^ j);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return true if the end point (final state) can be reached
|
||||
* from element 'p' without crossing any labeled elements.
|
||||
*/
|
||||
I
|
||||
isfinal(p)
|
||||
I p;
|
||||
{
|
||||
return (
|
||||
final || p == next || (
|
||||
ISJUMP(array[p]) && (
|
||||
(array[p] != PASS && isfinal(JUMP(array[p])))
|
||||
|| isfinal(p+1)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return true if the given string matches. The search string must
|
||||
* be of the form "\ntext\n\0" in order to handle line anchoring.
|
||||
*/
|
||||
I
|
||||
match(p)
|
||||
C *p;
|
||||
{
|
||||
I state, i, j, k;
|
||||
final = state = 0;
|
||||
while (*p != '\0' && 0 <= state) {
|
||||
if (0 < (i = dfa[state][*p])) {
|
||||
/* Transition on known DFA state. */
|
||||
state = i;
|
||||
} else {
|
||||
/* Perform lazy DFA evaluation from NFA.
|
||||
*
|
||||
* Compute new_set, which represents a transition
|
||||
* from the current state's set on character *p.
|
||||
* dfa[state]['\0'] contains the set[] index for
|
||||
* the current state.
|
||||
*/
|
||||
chr = *p;
|
||||
i = dfa[state]['\0'];
|
||||
j = new_set = next_set;
|
||||
do
|
||||
from(set[i++]+1);
|
||||
while (set[i] != MEMBER);
|
||||
|
||||
/* Determine if this is a known set or not. */
|
||||
i = k = 0;
|
||||
while (i < new_set) {
|
||||
if (set[i] == MEMBER) {
|
||||
j = new_set;
|
||||
++k;
|
||||
}
|
||||
if (set[i++] == set[j]) {
|
||||
if (next_set <= ++j) {
|
||||
j = new_set;
|
||||
if (set[i] == MEMBER) {
|
||||
/* Known set found. */
|
||||
next_set = new_set;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
j = new_set;
|
||||
}
|
||||
}
|
||||
if (new_set < next_set)
|
||||
/* New set found. */
|
||||
dfa[++k]['\0'] = new_set;
|
||||
state = dfa[state][*p] = final ? -1 : k;
|
||||
}
|
||||
++p;
|
||||
}
|
||||
return (state < 0);
|
||||
}
|
||||
|
||||
+7
-9
@@ -403,7 +403,7 @@ Location: <a href="../../location.html#CA">CA</a> - <em>Canada</em></li>
|
||||
<!-- BEFORE: 1st line of markdown file: 1993/ant/README.md -->
|
||||
<h2 id="to-build">To build:</h2>
|
||||
<pre><code> make all</code></pre>
|
||||
<p>The author provided a deobfuscated version. See <a href="#alternate-code">Alternate
|
||||
<p>The author provided an unobfuscated version. See <a href="#alternate-code">Alternate
|
||||
code</a> below.</p>
|
||||
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
|
||||
<p>The current status of this entry is:</p>
|
||||
@@ -415,8 +415,8 @@ code</a> below.</p>
|
||||
<h2 id="try">Try:</h2>
|
||||
<pre><code> ./try.sh</code></pre>
|
||||
<h2 id="alternate-code">Alternate code:</h2>
|
||||
<p>The <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1993/ant/deobfuscated/ant.c">ant.c in deobfuscated/</a> is a
|
||||
deobfuscated version provided by the author. You can look at this code if you
|
||||
<p>The <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1993/ant/ant.alt.c">ant.alt.c</a> is an
|
||||
unobfuscated version provided by the author. You can look at this code if you
|
||||
want some clues in how it works.</p>
|
||||
<h2 id="alternate-build">Alternate build:</h2>
|
||||
<p>If you wish to build this deobfuscated version, you can do so like:</p>
|
||||
@@ -472,14 +472,12 @@ more information.</p>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1993/ant/ant.orig.c">ant.orig.c</a> - original source code</li>
|
||||
<li><a href="ant.txt">ant.txt</a> - ag man page</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1993/ant/try.sh">try.sh</a> - script to try entry</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1993/ant/deobfuscated/ant-c89.c">deobfuscated/ant-c89.c</a> - author provided deobfuscated code converted from K&R</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1993/ant/deobfuscated/ant.c">deobfuscated/ant.c</a> - author provided deobfuscated code</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1993/ant/try.alt.sh">try.alt.sh</a> - script to try deobfuscated code</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1993/ant/deobfuscated/Makefile">deobfuscated/Makefile</a> - author provided Makefile for deobfuscated code</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1993/ant/deobfuscated/test.mk">deobfuscated/test.mk</a> - author provided test suite Makefile for deobfuscated code</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1993/ant/ant.alt.c">ant.alt.c</a> - author provided unobfuscated code</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1993/ant/try.alt.sh">try.alt.sh</a> - script to try unobfuscated code</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1993/ant/test.alt.mk">test.alt.mk</a> - author provided test suite Makefile for unobfuscated code</li>
|
||||
<li><a href="ants.txt">ants.txt</a> - lyrics of the Ants Go Marching song</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1993/ant/ant.test.mk">ant.test.mk</a> - test suite Makefile</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1993/ant/ant.alt.test.mk">ant.alt.test.mk</a> - test suite Makefile for deobfuscated code</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1993/ant/ant.alt.test.mk">ant.alt.test.mk</a> - test suite Makefile for unobfuscated code</li>
|
||||
</ul>
|
||||
<h2 id="secondary-files">Secondary files</h2>
|
||||
<ul>
|
||||
|
||||
@@ -13,13 +13,13 @@ all: char word anchor literal wild closure option branch sub class
|
||||
#
|
||||
|
||||
empty:
|
||||
$(PRG) '' test.mk
|
||||
$(PRG) '' test.alt.mk
|
||||
|
||||
char:
|
||||
$(PRG) 'q' test.mk
|
||||
$(PRG) 'q' test.alt.mk
|
||||
|
||||
word:
|
||||
$(PRG) 'simple' test.mk
|
||||
$(PRG) 'simple' test.alt.mk
|
||||
|
||||
#
|
||||
# Test meta characters.
|
||||
@@ -28,28 +28,28 @@ word:
|
||||
anchor: anchor1 anchor2 anchor3 anchor4 anchor5
|
||||
|
||||
anchor1:
|
||||
$(PRG) '^anchor1' test.mk
|
||||
$(PRG) '^anchor1' test.alt.mk
|
||||
|
||||
anchor2:
|
||||
$(PRG) 'Grep$$' test.mk
|
||||
$(PRG) 'Grep$$' test.alt.mk
|
||||
|
||||
#
|
||||
# Find all empty lines.
|
||||
#
|
||||
anchor3:
|
||||
$(PRG) '^$$' test.mk
|
||||
$(PRG) '^$$' test.alt.mk
|
||||
|
||||
#
|
||||
# This is valid but will never match.
|
||||
#
|
||||
anchor4:
|
||||
-$(PRG) 'x^a' test.mk
|
||||
-$(PRG) 'x^a' test.alt.mk
|
||||
|
||||
#
|
||||
# This is valid but will never match.
|
||||
#
|
||||
anchor5:
|
||||
-$(PRG) 'mk$$x' test.mk
|
||||
-$(PRG) 'mk$$x' test.alt.mk
|
||||
|
||||
literal: literal1 literal2
|
||||
|
||||
@@ -57,13 +57,13 @@ literal: literal1 literal2
|
||||
# Every line with a dollar-sign.
|
||||
#
|
||||
literal1:
|
||||
$(PRG) '\$$' test.mk
|
||||
$(PRG) '\$$' test.alt.mk
|
||||
|
||||
#
|
||||
# Every line with a backslash.
|
||||
#
|
||||
literal2:
|
||||
$(PRG) '\\' test.mk
|
||||
$(PRG) '\\' test.alt.mk
|
||||
|
||||
#
|
||||
# wild #1#
|
||||
@@ -71,7 +71,7 @@ literal2:
|
||||
# wild #%#
|
||||
#
|
||||
wild:
|
||||
$(PRG) '#.#' test.mk
|
||||
$(PRG) '#.#' test.alt.mk
|
||||
|
||||
#
|
||||
# closure !!
|
||||
@@ -79,7 +79,7 @@ wild:
|
||||
# closure !xxxxxx!
|
||||
#
|
||||
closure:
|
||||
$(PRG) 'closure !x*!' test.mk
|
||||
$(PRG) 'closure !x*!' test.alt.mk
|
||||
|
||||
#
|
||||
# option ++
|
||||
@@ -91,45 +91,45 @@ closure:
|
||||
option: option1 option2
|
||||
|
||||
option1:
|
||||
$(PRG) '+b?+' test.mk
|
||||
$(PRG) '+b?+' test.alt.mk
|
||||
|
||||
option2:
|
||||
$(PRG) '+.?+' test.mk
|
||||
$(PRG) '+.?+' test.alt.mk
|
||||
|
||||
branch: branch1 branch2 branch3 branch4 branch5 branch6
|
||||
|
||||
branch1:
|
||||
$(PRG) 'q|simple' test.mk
|
||||
$(PRG) 'q|simple' test.alt.mk
|
||||
|
||||
#
|
||||
# This pattern should be the same as '(^all)|(Public)|(Grep$)'.
|
||||
#
|
||||
branch2:
|
||||
$(PRG) '^all|Public|Grep$$' test.mk
|
||||
$(PRG) '^all|Public|Grep$$' test.alt.mk
|
||||
|
||||
#
|
||||
# This pattern should generate the same results as branch2.
|
||||
#
|
||||
branch3:
|
||||
$(PRG) 'Grep$|^all|Public' test.mk
|
||||
$(PRG) 'Grep$|^all|Public' test.alt.mk
|
||||
|
||||
#
|
||||
# Null expression between start of pattern and vertical-line.
|
||||
#
|
||||
branch4:
|
||||
$(PRG) '|Grep' test.mk
|
||||
$(PRG) '|Grep' test.alt.mk
|
||||
|
||||
#
|
||||
# Null expression between vertical-line and end of pattern.
|
||||
#
|
||||
branch5:
|
||||
$(PRG) 'Grep|' test.mk
|
||||
$(PRG) 'Grep|' test.alt.mk
|
||||
|
||||
#
|
||||
# Null expression between vertical-line and vertical-line.
|
||||
#
|
||||
branch6:
|
||||
$(PRG) 'all||Grep' test.mk
|
||||
$(PRG) 'all||Grep' test.alt.mk
|
||||
|
||||
#
|
||||
# sub aabcbcbcxx
|
||||
@@ -144,49 +144,49 @@ sub: sub0 sub1 sub2 sub3 sub4 sub5 lparen1 lparen2 rparen1 rparen2
|
||||
# Null sub-expressions.
|
||||
#
|
||||
sub0:
|
||||
$(PRG) 's()u()b()' test.mk
|
||||
$(PRG) 's()u()b()' test.alt.mk
|
||||
|
||||
sub1:
|
||||
$(PRG) '#(1|%)#' test.mk
|
||||
$(PRG) '#(1|%)#' test.alt.mk
|
||||
|
||||
sub2:
|
||||
$(PRG) 'aa((bc)*|g)xx' test.mk
|
||||
$(PRG) 'aa((bc)*|g)xx' test.alt.mk
|
||||
|
||||
#
|
||||
# Null expression between the left-parenthesis and the vertical-line.
|
||||
#
|
||||
sub3:
|
||||
$(PRG) '#(|1)#' test.mk
|
||||
$(PRG) '#(|1)#' test.alt.mk
|
||||
|
||||
#
|
||||
# Null expression between the vertical-line and the right-parenthesis.
|
||||
#
|
||||
sub4:
|
||||
$(PRG) '#(1|)#' test.mk
|
||||
$(PRG) '#(1|)#' test.alt.mk
|
||||
|
||||
#
|
||||
# Null expression between the vertical-line and the right-parenthesis.
|
||||
#
|
||||
sub5:
|
||||
$(PRG) '#(%||1)#' test.mk
|
||||
$(PRG) '#(%||1)#' test.alt.mk
|
||||
|
||||
#
|
||||
# Missing left-parenthesis generates an error.
|
||||
#
|
||||
lparen1:
|
||||
-$(PRG) 'left ( only' test.mk
|
||||
-$(PRG) 'left ( only' test.alt.mk
|
||||
|
||||
lparen2:
|
||||
$(PRG) 'left \( only' test.mk
|
||||
$(PRG) 'left \( only' test.alt.mk
|
||||
|
||||
#
|
||||
# Right-parenthesis without preceding left parenthesis should be a literal.
|
||||
#
|
||||
rparen1:
|
||||
-$(PRG) 'right ) only' test.mk
|
||||
-$(PRG) 'right ) only' test.alt.mk
|
||||
|
||||
rparen2:
|
||||
$(PRG) 'right \) only' test.mk
|
||||
$(PRG) 'right \) only' test.alt.mk
|
||||
|
||||
#
|
||||
# 12345678
|
||||
@@ -208,26 +208,26 @@ rparen2:
|
||||
class: class1 class2 class3 class4 class5 class6 class7 class8
|
||||
|
||||
class1:
|
||||
$(PRG) '=[09]=' test.mk
|
||||
$(PRG) '=[09]=' test.alt.mk
|
||||
|
||||
class2:
|
||||
$(PRG) '=[^09]=' test.mk
|
||||
$(PRG) '=[^09]=' test.alt.mk
|
||||
|
||||
class3:
|
||||
$(PRG) '=[]]=' test.mk
|
||||
$(PRG) '=[]]=' test.alt.mk
|
||||
|
||||
class4:
|
||||
$(PRG) '=[^]]=' test.mk
|
||||
$(PRG) '=[^]]=' test.alt.mk
|
||||
|
||||
class5:
|
||||
$(PRG) '=[0-9]=' test.mk
|
||||
$(PRG) '=[0-9]=' test.alt.mk
|
||||
|
||||
class6:
|
||||
$(PRG) '=[^0-9]=' test.mk
|
||||
$(PRG) '=[^0-9]=' test.alt.mk
|
||||
|
||||
class7:
|
||||
-$(PRG) '=[3-1]=' test.mk
|
||||
-$(PRG) '=[3-1]=' test.alt.mk
|
||||
|
||||
class8:
|
||||
$(PRG) '=[-13]=' test.mk
|
||||
$(PRG) '=[-13]=' test.alt.mk
|
||||
|
||||
Reference in new issue
Block a user