diff -uNr a/gscm/command/.keep b/gscm/command/.keep --- a/gscm/command/.keep f232109157b9d22fecc1ce426b7dd8513530d23917cc566b0925e1ef0769169c21223c323e7ab5bdafea431b09d57b17bb44eb2b0efbd3c2437a611ce00f097f +++ b/gscm/command/.keep false @@ -1 +0,0 @@ -version control placeholder diff -uNr a/gscm/command/keep b/gscm/command/keep --- a/gscm/command/keep false +++ b/gscm/command/keep f232109157b9d22fecc1ce426b7dd8513530d23917cc566b0925e1ef0769169c21223c323e7ab5bdafea431b09d57b17bb44eb2b0efbd3c2437a611ce00f097f @@ -0,0 +1 @@ +version control placeholder diff -uNr a/gscm/doc/CHANGES b/gscm/doc/CHANGES --- a/gscm/doc/CHANGES 75cc14c68063f12efc27bf2b7eb9bf7a83aa496cef7c9d4ceb04d5d5bd10aeba2a89869171903624beee7f94b37a2b5ca4e69bc21ba9afe9d8ce77731a1a95a1 +++ b/gscm/doc/CHANGES fdb8da8eb5e1f8b0c2b551319fb20d1d3ec2704c7ee5b81b851978321c679da440a7b35c567854bde6262c6a084ef15e2e7be7886c2a2a5de3927a8ea8ae6ffa @@ -745,3 +745,17 @@ - Non-meaningful newlines in human text: bad - "if" as a special "lisp word" producing less indentation: bad - Code width: mostly sticking to 80 columns + +September 2020: + +40.maint4. + +Core: +- Consistently allow HT, FF, and CR as whitespace in the lexer. (Early versions took a strict view of the standard and only allowed space or newline; at some point I loosened this to allow tab-indented files, but missed the delimiter lookahead cases.) + +Main: +- Fix -m argument parsing from bad backport in 40.maint2. + +Packaging: +- Fix version symlink update steps. (When a previous version existed, /package/gscm was being followed rather than replaced. djb got this right but apparently I tried to 'improve' it.) +- Placeholder file doesn't need to be hidden. diff -uNr a/gscm/manifest b/gscm/manifest --- a/gscm/manifest aad7baf2787f4cf9aa83ff22cc23eb2946010bf6e60df096b1ea36982a9e9a0ee2da4e3f5cf4da5d7e719263845662a2dd639ab5cde272aa6ab05967b8a50eee +++ b/gscm/manifest 5b5c5ac9da85b7fd7e81154f6454f2fb1aa229c900332ef1f07044e8ad3def44e0ffa7bf6ce0bd0b4e21abb85675ccda277c5cbf818886d2bb75739f3f445335 @@ -1 +1,2 @@ 648626 gscm_subdir_genesis jfw The Gales Scheme interpreter. (Reground from gscm_genesis to follow the project subdir and manifest naming conventions.) +648629 gscm_fix_m_whitespace_package_install jfw The -m argument to set heap memory allocation was broken; the control characters allowed as whitespace by the lexer were inconsistent; package installation was broken in the case of an existing version. diff -uNr a/gscm/package/README b/gscm/package/README --- a/gscm/package/README a331b4a6465eb256b65d809a577b3d158e20f44d9052408322e32ea234b8ea02664c26b255ffaa51c89fcde1556d5b8cdf42054eca2595fa1ee189cacfebd1a7 +++ b/gscm/package/README d82a416831f0f56194fc9cbcd99d1f31c92b13f4ecbad19b4b3d4e9e99a75a455766a1cfce0c2188183a4fa1ec68275bd6628faa85e452e7713d3280d627c872 @@ -17,7 +17,7 @@ 1. Press or otherwise install the tree at the path: - /package/gscm-0.40.3 + /package/gscm-0.40.4 The installation path is not configurable. This amounts to a claim on the global namespace, as command names always do. People and programs can count on finding components at known paths if they are to be found at all, as surely as with /bin/sh. This doesn't mean the files must physically exist under /package; for example, a symlink from there could ease working on the code as a non-root user. diff -uNr a/gscm/package/install b/gscm/package/install --- a/gscm/package/install 6f74c7e4e8a0b2923a429be3a3159cf5fda2b490aab33d8d3abd498e8c5fcb7494b917b9931fb37d6ea55ca1a4850726f33054f813b708349678e6010ae61b97 +++ b/gscm/package/install b84e6e172b451eac5ec40c0dfe77ddd44229abbbe04c818d7935cf2e6ddfa4b62bf1ab4f697779e44bf229852015f44dc04411881e26a9cf257b1645ddc51721 @@ -2,7 +2,7 @@ set -e P=gscm -V=0.40.3 +V=0.40.4 cd /package/$P-$V # Versioned path duplicated in: @@ -12,9 +12,9 @@ make -C src echo "Creating symlink $P -> $P-$V" -rm -f /package/$P'{new}' -ln -s $P-$V /package/$P'{new}' -mv -f /package/$P'{new}' /package/$P +rm -f $P +ln -s $P-$V $P +mv -f $P /package/ echo 'Making command links in /command' mkdir -p /command diff -uNr a/gscm/src/Makefile b/gscm/src/Makefile --- a/gscm/src/Makefile b316459fdeb9d43d3a59e816d81e7756dd91da9b975a64cdee4fade1194a852d0ae690fae0def63e8cc14b7cdeb70bf1679e55af4742a58a1c81a375c2eb18aa +++ b/gscm/src/Makefile 8358d6ac63a514ff6cdf2c69af4c8cc24dd40f5dae23a9593ed078cd7da2a1255c9df8e704f3ef052c831dfd9114b0bc11d4e117e7e880e3a5333486635ce5a2 @@ -1,4 +1,4 @@ -PREFIX := /package/gscm-0.40.3 +PREFIX := /package/gscm-0.40.4 ASM_ARCH := x86_64 CFLAGS := -std=c99 -pedantic -Wall -Wextra -Winit-self -Wstrict-aliasing=1 -g -O2 diff -uNr a/gscm/src/gscm.c b/gscm/src/gscm.c --- a/gscm/src/gscm.c b1b1de8605e906f79d7eed152dd0a2ab8522a380733859b35ffafa8bb6ca3321fad9b7b0e539070fb5663fc07a73d7d32a53258748e78284e728e940134f74bc +++ b/gscm/src/gscm.c ddbd6074b63bc27cfda3bb7389d71dc00f859250965846965268685a3b1470165739d4851b3320c8eb401abe9bb2181e8a19bc2775e129d301cfe39bb669dd91 @@ -1973,7 +1973,7 @@ return 0; } static int is_whitespace(int c) { return in_str(c, " \t\n\f\r"); } -static int is_delimiter(int c) { return c == EOF || in_str(c, " \n()\";"); } +static int is_delimiter(int c) { return c == EOF || in_str(c, " \t\n\f\r()\";"); } static int is_special_initial(int c) { return in_str(c, "!$%&*/:<=>?^_~"); } static int is_special_subsequent(int c) { return in_str(c, "+-.@"); } diff -uNr a/gscm/src/main.c b/gscm/src/main.c --- a/gscm/src/main.c fa3f7cdd3376c15f20d01c66d78bb405357932d7b82edce6e467a1dc22e4e02e10b326e33e90fca6f2b7e167e47c835cf70477a992843c0660a873026117521b +++ b/gscm/src/main.c 2be9d6e8e972c29b1c328c6c4ee9537771e8892cea8ba6405db6edee01daa1194eec4e86493ae324ae5285983c33d8e7382ee5d1bee9a47d612282d44108090b @@ -45,12 +45,11 @@ } int main(int argc, char **argv) { - char *arg; sc_value heap_mb = GSCM_DEF_HEAP, heap_alloc; -#define SHIFT { ++argv; --argc; } +#define SHIFT (++argv, --argc) if (argc) SHIFT; while (argc) { - arg = *argv; + char *arg = *argv; if (arg[0] != '-' || !arg[1] || (arg[1] == '-' && !arg[2])) break; while (*++arg) switch (*arg) { case 'H': @@ -61,16 +60,19 @@ case 'h': sc_write_error(usage); return 0; case 'm': - SHIFT; - if (!argc) { - sc_write_error("gscm: missing -m argument\n"); - goto err; + if (!*++arg) { + SHIFT; + if (!argc) { + sc_write_error("gscm: -m missing argument\n"); + goto err; + } + arg = *argv; } if (!(parse_ulong_dec(&heap_mb, arg) && heap_mb)) { sc_write_error("gscm: bad -m argument\n"); goto err; } - break; + goto next_arg; default: { char tail[] = {*arg, '\n', 0}; @@ -79,6 +81,7 @@ goto err; } } +next_arg: SHIFT; } heap_alloc = heap_mb<<21;