chiark / gitweb /
base91: Patch the C version for our charset change
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 17 Nov 2019 01:49:18 +0000 (01:49 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 7 Dec 2019 17:08:51 +0000 (17:08 +0000)
The base91.c.patch file was made by editing base91.c by hand and
running git diff.  The change to enctab is the obvious one.
The change to dectab was simply done by hand based on inspection.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
base91s/Subdir.sd.mk
base91s/base91.c.patch [new file with mode: 0644]

index d41ca9ab807cb248db916f7ac8490ff2650ad734..f82eea78b4ca8400b0136af3ba8574e9d1fd3c1f 100644 (file)
@@ -5,9 +5,11 @@
 &CFILES += & base91.c base91.h cli.c
 &CLEAN += $(&CFILES)
 
+&base91.c: &^base91.c.patch
 $(&CFILES): &/%: &~/base91-c/% &/Subdir.mk
        perl -pe <$< >$@.tmp \
  'next if m{^\#include}; s/basE91/base91s/g; s/base91\b/base91s/g'
+       patch <$(or $(filter %.patch,$^),/dev/null) $@.tmp
        mv -f $@.tmp $@
 
 $(&OBJECTS): &base91.h
diff --git a/base91s/base91.c.patch b/base91s/base91.c.patch
new file mode 100644 (file)
index 0000000..1078d5a
--- /dev/null
@@ -0,0 +1,19 @@
+diff --git a/base91.c b/base91.c
+index 3d9d7ea..7a5958a 100644
+--- a/base91.c
++++ b/base91.c
+@@ -38,12 +38,12 @@ const unsigned char enctab[91] = {
+       'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
+       '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '!', '#', '$',
+       '%', '&', '(', ')', '*', '+', ',', '.', '/', ':', ';', '<', '=',
+-      '>', '?', '@', '[', ']', '^', '_', '`', '{', '|', '}', '~', '"'
++      '>', '?', '@', '[', ']', '^', '_', '`', '{', '|', '}', '~', '-'
+ };
+ const unsigned char dectab[256] = {
+       91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91,
+       91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91,
+-      91, 62, 90, 63, 64, 65, 66, 91, 67, 68, 69, 70, 71, 91, 72, 73,
++      91, 62, 91, 63, 64, 65, 66, 91, 67, 68, 69, 70, 71, 90, 72, 73,
+       52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 74, 75, 76, 77, 78, 79,
+       80,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14,
+       15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 81, 91, 82, 83, 84,