joe-3.1jupp32.tgz jupp-3_1_32
authormirabilos <m@mirbsd.org>
Sat, 16 Dec 2017 22:59:08 +0000 (23:59 +0100)
committermirabilos <m@mirbsd.org>
Sat, 16 Dec 2017 22:59:08 +0000 (23:59 +0100)
Make-w32.sh
NEWS
builtins.c
configure
configure.ac
menu.c
path.c
uedit.c
umath.c
usearch.c

index a72ea35..387b0f1 100644 (file)
@@ -1,5 +1,5 @@
 #!/bin/mksh
-# $MirOS: contrib/code/jupp/Make-w32.sh,v 1.21 2017/12/07 01:00:30 tg Exp $
+# $MirOS: contrib/code/jupp/Make-w32.sh,v 1.22 2017/12/16 22:05:25 tg Exp $
 
 usage() {
        print -ru2 "Usage: $0 [-bCgn]"
@@ -54,6 +54,7 @@ cd mkw32/build
 export CFLAGS='-Os -march=i486 -mtune=pentium-mmx'
 export CPPFLAGS='-DJUPPRC_BUILTIN_NAME=\"jupp32rc\"'
 (( contb )) || mksh ../../configure \
+    --build=i486-pc-cygwin --host=i486-pc-cygwin \
     --prefix=c:/windows/system32 \
     --sysconfdir=c:/windows/system32 \
     --disable-dependency-tracking \
diff --git a/NEWS b/NEWS
index 6e2881a..ab72bb5 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,8 +1,12 @@
-$MirOS: contrib/code/jupp/NEWS,v 1.111 2017/12/03 03:26:18 tg Exp $
+$MirOS: contrib/code/jupp/NEWS,v 1.112 2017/12/16 22:18:51 tg Exp $
 -------------------------------------------------------------------
 
 jupp-current
 
+- …
+
+JOE 3.1jupp32
+
 - Harmonise help rendering in jupprc (also for 2.8, 3.7, (NEW) 4.4)
 - Update internationalisation data to Unicode 10.0.0 with bugfixes
 - Don’t limit JOE_FILENAME
@@ -14,6 +18,13 @@ jupp-current
 - Add way to disable use of the FPU (including Math), for klibc
 - Make assume_color[sic!] actually work
 - Recognise libncursesw for tgetflag(3); add --disable-terminfo
+- Add a flag to disable SELinux even if found
+- Modernise C features to C89 (prototypes!)
+- Do not crash if inserting text from a macro after cursor moved
+- With -DSMALL, use 8 KiB less .bss
+- Do not write duplicate entries, e.g. into filename history
+- Begin handling some pointer polymorphism more correctly
+- Plug a few memory leaks
 
 JOE 3.1jupp31
 
index 09a355f..588bd63 100644 (file)
@@ -11,7 +11,7 @@
 #include "config.h"
 #include "types.h"
 
-__RCSID("$MirOS: contrib/code/jupp/builtins.c,v 1.26 2017/12/02 02:07:24 tg Exp $");
+__RCSID("$MirOS: contrib/code/jupp/builtins.c,v 1.27 2017/12/16 22:18:52 tg Exp $");
 
 #ifndef JUPPRC_BUILTIN_NAME
 #define JUPPRC_BUILTIN_NAME "jupprc"
@@ -73,7 +73,7 @@ const unsigned char * const builtins[] = {
                "-spaces\n"
                "\n"
                "{Basic\n"
-               "\\i   Help Screen    turn off with ^J     more help with ESC . (^[.)              \\i\n"
+               "\\i   Help Screen    turn off with ^J     more help with Esc+. (^[.)              \\i\n"
                "\\i \\i\\u\\bCURSOR\\b\\u           \\u\\bGOTO\\b\\u             \\u\\bBLOCK\\b\\u    \\u\\bDELETE\\b\\u    \\u\\bMISC\\b\\u         \\u\\bEXIT\\b\\u       \\i \\i\n"
                "\\i \\i^S left ^D right ^R  prev. screen ^KV move ^G  char  ^B  reformat ^KX save   \\i \\i\n"
                "\\i \\i^E up   ^X down  ^C  next screen  ^KC copy ^Y  line  ^V  overtype ^KQ abort  \\i \\i\n"
@@ -81,29 +81,29 @@ const unsigned char * const builtins[] = {
                "\\i \\i^F next word     ^QD end of line  ^K/ pipe ^QY >line ^O  options  \\u\\bFILE\\b\\u       \\i \\i\n"
                "\\i \\i\\u\\bSEARCH\\b\\u           ^QR top of file  ^KB begin          \\u\\bBUFFER\\b\\u       ^KE new    \\i \\i\n"
                "\\i \\i^QF find first   ^QC end of file  ^KK end            ^U undo      ^KR import \\i \\i\n"
-               "\\i \\i^L  find next    ^QO byte offset  ^KD reformat       ^^ redo      ^KW export \\i \\i\n"
+               "\\i \\i^L  find next    ^QP prev. place  ^KD reformat       ^^ redo      ^KW export \\i \\i\n"
                "}\n"
                "\n"
                "{Windows\n"
                "\\i   Help Screen    turn off with ^J     prev. screen ^[,    next screen ^[.     \\i\n"
-               "\\i \\i^KO Split the window in half          ^KE Load file into new window          \\i \\i\n"
-               "\\i \\i^KG Make current window bigger        ^KT Make current window smaller        \\i \\i\n"
-               "\\i \\i^KN Go to the window below            ^KP Go to the window above             \\i \\i\n"
-               "\\i \\i^KQ Eliminate the current window      ^KI Show all windows / Show one window \\i \\i\n"
-               "\\i \\i^K; Run a ctags search                ^K- Edit scratch buffer in new window  \\i \\i\n"
+               "\\i \\i^KO split the window in half          ^KE load file into new window          \\i \\i\n"
+               "\\i \\i^KG make current window bigger        ^KT make current window smaller        \\i \\i\n"
+               "\\i \\i^KN go to the window below            ^KP go to the window above             \\i \\i\n"
+               "\\i \\i^KQ eliminate the current window      ^KI show all windows / show one window \\i \\i\n"
+               "\\i \\i^K; run a ctags search                ^K- edit scratch buffer in new window  \\i \\i\n"
                "\\i \\i Note: some commands (^KE ^K; ^K-) hide the current window; use ^KI/^KN then \\i \\i\n"
-               "\\i \\i\\u\\bSpecial help for XON/XOFF aware terminals:\\b\\u                                   \\i \\i\n"
+               "\\i \\i  \\u\\bSpecial help for XON/XOFF aware terminals:\\b\\u                                 \\i \\i\n"
                "\\i \\i You can use \\b^[q\\b and \\b^[s\\b instead of \\b^Q\\b and \\b^S\\b to initiate a command.         \\i \\i\n"
                "}\n"
                "\n"
                "{Advanced\n"
                "\\i   Help Screen    turn off with ^J     prev. screen ^[,    next screen ^[.     \\i\n"
                "\\i \\i\\u\\bMACROS\\b\\u       \\u\\bMISC\\b\\u         \\u\\bSCROLL\\b\\u      \\u\\bSHELL\\b\\u       \\u\\bGOTO\\b\\u        \\u\\bI-SEARCH\\b\\u       \\i \\i\n"
-               "\\i \\i^[( Record   ^Q? status   ^Q. Right   ^K' Window  ^QB to ^KB  ^[R Backwards  \\i \\i\n"
-               "\\i \\i^[) Stop     ^QQ repeat   ^Q, Left    ^[! Command ^QK to ^KK  ^[S Forwards   \\i \\i\n"
-               "\\i \\i^[? Query    ^QM Math     \\u\\bCharSEARCH\\b\\u  \\u\\bQUOTE\\b\\u       \\u\\bDELETE\\b\\u      \\u\\bBOOKMARKS\\b\\u      \\i \\i\n"
-               "\\i \\i^[D Dump     ^[H Message  ^QH forwrd   ` Ctrl-    ^[Y yank    ^K 0-9 Set     \\i \\i\n"
-               "\\i \\i^[ 0-9 Play  ^N  Play #0  ^QG backwd  ^P Meta-    ^[O word<   ^Q 0-9 Goto    \\i \\i\n"
+               "\\i \\i^[( record   ^Q? status   ^Q. right   ^K' window  ^QB to ^KB  ^[R backwards  \\i \\i\n"
+               "\\i \\i^[) stop     ^QQ repeat   ^Q, left    ^[! command ^QK to ^KK  ^[S forwards   \\i \\i\n"
+               "\\i \\i^[? query    ^QM math     \\u\\bCharSEARCH\\b\\u  \\u\\bQUOTE\\b\\u       \\u\\bDELETE\\b\\u      \\u\\bBOOKMARKS\\b\\u      \\i \\i\n"
+               "\\i \\i^[D dump     ^[H message  ^QH forwrd   ` Ctrl-    ^[Y yank    ^K 0-9 define  \\i \\i\n"
+               "\\i \\i^[ 0-9 play  ^N  play #0  ^QG backwd  ^P Meta-    ^[O word<   ^Q 0-9 goto    \\i \\i\n"
                "\\i \\i \\u\\bIn math mode,\\b\\u use 0xCAFE for hex. All ops are floating point internally.    \\i \\i\n"
                "\\i \\i \\u\\bPredefined variables:\\b\\u byte col height line lines top width                  \\i \\i\n"
                "}\n"
@@ -111,27 +111,27 @@ const unsigned char * const builtins[] = {
                "{Programs\n"
                "\\i   Help Screen    turn off with ^J     prev. screen ^[,    next screen ^[.     \\i\n"
                "\\i \\i\\u\\bGOTO\\b\\u                               \\u\\bCOMPILING\\b\\u                    \\u\\bSLIDING\\b\\u      \\i \\i\n"
-               "\\i \\i^Q] matching brace, ^Q[ reverse    ^[C compile & parse errors   ^W up        \\i \\i\n"
-               "\\i \\i^Q= merge conflict marker          ^[E parse errors             ^Z down      \\i \\i\n"
-               "\\i \\i^Q- to column number  \\u\\bINDENT\\b\\u       ^KF save, compile & upload to NXT brick   \\i \\i\n"
-               "\\i \\i^QI to line number    ^K. more     \\u\\bGOTO AFTER COMPILING\\b\\u         \\u\\bINSERT MATH\\b\\u  \\i \\i\n"
-               "\\i \\i^QP previous place    ^K, less     ^[N previous error           ^[# equation \\i \\i\n"
-               "\\i \\i^K= next place        ^KA centre   ^[M next error      \\u\\bSPECIAL\\b\\u  ^[= result   \\i \\i\n"
-               "\\i \\i                      ^K] kill whitespace at EOL       ^[- jupp command line \\i \\i\n"
+               "\\i \\i^Q= next merge conflict marker     ^[C compile & parse errors   ^W up        \\i \\i\n"
+               "\\i \\i^Q] next matching brace            ^[E parse errors             ^Z down      \\i \\i\n"
+               "\\i \\i^Q[ previous   \"   \"  \\u\\bINDENT\\b\\u       ^KF save, compile & upload to NXT brick   \\i \\i\n"
+               "\\i \\i^Q- to column number  ^K. more     \\u\\bGOTO AFTER COMPILING\\b\\u         \\u\\bINSERT MATH\\b\\u  \\i \\i\n"
+               "\\i \\i^QI to line number    ^K, less     ^[N previous error           ^[# equation \\i \\i\n"
+               "\\i \\i^QO to byte offset    ^KA centre   ^[M next error      \\u\\bSPECIAL\\b\\u  ^[= result   \\i \\i\n"
+               "\\i \\i^K= next place        ^K] kill whitespace at EOL/EOF   ^[- jupp command line \\i \\i\n"
                "}\n"
                "\n"
                "{Search\n"
                "\\i   Help Screen    turn off with ^J     prev. screen ^[,    next screen ^[.     \\i\n"
-               "\\i \\i\\u\\bSpecial search sequences:\\b\\u                                                    \\i \\i\n"
-               "\\i \\i    \\\\^  \\\\$  matches beg./end of line       \\\\?     match any single char      \\i \\i\n"
-               "\\i \\i    \\\\<  \\\\>  matches beg./end of word       \\\\*     match 0 or more chars      \\i \\i\n"
-               "\\i \\i    \\\\c     matches balanced C expression   \\\\\\\\     matches a \\\\                \\i \\i\n"
-               "\\i \\i    \\\\[..]  matches one of a set            \\\\n     matches a newline          \\i \\i\n"
-               "\\i \\i    \\\\+     matches 0 or more of the character which follows the \\\\+           \\i \\i\n"
-               "\\i \\i\\u\\bSpecial replace sequences:\\b\\u                                                   \\i \\i\n"
-               "\\i \\i    \\\\&     replaced with text which matched search string                    \\i \\i\n"
-               "\\i \\i    \\\\0 - 9 replaced with text which matched \\bN\\bth \\\\*, \\\\?, \\\\c, \\\\+, or \\\\[..]     \\i \\i\n"
-               "\\i \\i    \\\\\\\\     replaced with \\\\                 \\\\n     replaced with newline      \\i \\i\n"
+               "\\i \\i \\u\\bSpecial search sequences:\\b\\u                                                   \\i \\i\n"
+               "\\i \\i  \\\\^  \\\\$  matches beg./end of line         \\\\?     match any single char      \\i \\i\n"
+               "\\i \\i  \\\\<  \\\\>  matches beg./end of word         \\\\*     match 0 or more chars      \\i \\i\n"
+               "\\i \\i  \\\\c      matches balanced C expression    \\\\\\\\     matches a backslash (\\\\)    \\i \\i\n"
+               "\\i \\i  \\\\[a-z]  matches one of a set, ^ inverts  \\\\n     matches a newline          \\i \\i\n"
+               "\\i \\i  \\\\+      matches 0 or more of the character which follows the \\\\+            \\i \\i\n"
+               "\\i \\i \\u\\bSpecial replace sequences:\\b\\u                                                  \\i \\i\n"
+               "\\i \\i  \\\\\\\\      replaced with a backslash (\\\\)    \\\\n     replaced with a newline    \\i \\i\n"
+               "\\i \\i  \\\\&      replaced with the text which matched the search string             \\i \\i\n"
+               "\\i \\i  \\\\0 - 9  replaced with text which matched \\bN+1\\bth \\\\?, \\\\*, \\\\c, \\\\[a-z] or \\\\+    \\i \\i\n"
                "}\n"
                "\n"
                "{Names\n"
@@ -152,7 +152,7 @@ const unsigned char * const builtins[] = {
                "\\i \\i go to \\uhttp://sf.net/projects/joe-editor/\\u for upstream bug reports. JUPP 2.8 \\i \\i\n"
                "\\i \\i for DOS compiled by A. Totlis, packed with LHarc 2.13; JUPP 3.x for UNIX\\d(R)\\d \\i \\i\n"
                "\\i \\i at \\uhttp://mirbsd.de/jupp\\u and by \\bThorsten \"\\dmirabilos\\d\" Glaser <\\utg@mirbsd.org\\u>\\b \\i \\i\n"
-               "\\i \\i @(#) blt_in 2017-08-08; 3.1; autoCR-LF; UTF-8 via locale; per-file encoding \\i \\i\n"
+               "\\i \\i @(#) blt_in 2017-12-06; 3.1; autoCR-LF; UTF-8 via locale; per-file encoding \\i \\i\n"
                "}\n"
                "\n"
                "{CharTable\n"
@@ -187,8 +187,10 @@ const unsigned char * const builtins[] = {
                "explode                ^K ^I\n"
                "explode                ^K i\n"
                "explode                ^[ [ 1 7 ~\n"
+               "explode                .k6\n"
                "help           ^J\n"
                "help           ^[ [ 1 1 ~\n"
+               "help           .k1\n"
                "hnext          ^[ .\n"
                "hprev          ^[ ,\n"
                "math           ^Q M\n"
@@ -203,11 +205,13 @@ const unsigned char * const builtins[] = {
                "nextw          ^K ^N\n"
                "nextw          ^K n\n"
                "nextw          ^[ [ 1 9 ~\n"
+               "nextw          .k8\n"
                "play           ^[ 0 TO 9\n"
                "prevw          ^K P\n"
                "prevw          ^K ^P\n"
                "prevw          ^K p\n"
                "prevw          ^[ [ 1 8 ~\n"
+               "prevw          .k7\n"
                "query          ^[ ?\n"
                "quote          `\n"
                "quote8         ^P\n"
@@ -239,10 +243,11 @@ const unsigned char * const builtins[] = {
                "\n"
                ":main\n"
                ":inherit windows\n"
-               ":def freedroidz splitw,prevw,scratch,\"nbc-Output\",rtn,nextw,save,markk,bol,markb,prevw,prevw,blkcpy,nextw,nextw,rtn,prevw,eol,\"'\",bol,qrepl,\"'\",rtn,rtn,\"'\\\\\\\\''\",rtn,\"r\",backs,backs,backs,bol,\"LC_ALL=C; export LC_ALL; fn='\",eol,rtn,\"p=--posix; sed $p -e q </dev/null >/dev/null 2>&1 || p=; fns=$(echo \\\"$fn\\\" | sed $p -e 's\ 1[^^]\ 1[&]\ 1g; s\ 1\\\\^\ 1\\\\\\\\^\ 1g'); (case $fn in\",rtn,\"*.nxc) ;;\",rtn,\"*) echo '==> Error: filename not *.nxc'; exit ;;\",rtn,\"esac\",rtn,\"echo \\\"Compiling $fn\\\"\",rtn,\"nbc -sm- -d \\\"$fn\\\" 2>&1; x=$?\",rtn,\"if test $x = 0; then echo '==> OK'; else echo '==> Error code:' $x; fi\",rtn,\") | tr '\\\\n' '\ 1' | sed $p -e 's!\ 1# *\\\\([^\ 1]*\\\\)\ 1File \\\"[^\\\"]*/\\\\('\\\"$fns\\\"'\\\\)\\\" ; line \\\\([0-9]*\\\\)\ 1!\ 1\\\\2:\\\\3: \\\\1\ 1!g' -e 's!\ 1#\\\\([^\ 1]*\\\\)\ 1File \\\"\\\\([^\\\"]*\\\\)\\\" ; line \\\\([0-9]*\\\\)\ 1!\ 1\\\\2:\\\\3: \\\\1\ 1!g' | tr '\ 1' '\\\\n'\",rtn,nmark,filt,\"sh\",rtn,rtn,\"Press ^KQ to close this window!\",rtn,parserr\n"
+               ":def pastemain helpcard,\"Paste\",rtn,keymap,\"Paste\",rtn\n"
+               ":def conflictmarker ffirst,\"\\\\^\\\\[<>=]\\\\[<>=]\\\\[<>=]\\\\[<>=]\\\\[<>=]\\\\[<>=]\\\\[<>=]\\\\[ \\\\n]\",rtn,rtn,ltarw\n"
+               ":def fixwhitespace eof,\" \",bof,\"a\",qrepl,\"\\\\[\",quote,\"i\",quote,\"k\",quote,\"l\",quote,\"m ]\\\\+\\\\[\",quote,\"i\",quote,\"k\",quote,\"l\",quote,\"m ]\\\\$\",rtn,rtn,rtn,\"r\",eof,rtn,ffirst,\"\\\\^\\\\[^\\\\n]\",rtn,\"b\",rtn,eol,markb,bof,delch,eof,markk,blkdel,ffirst,\"\\\\?\",rtn,\"b\",rtn,eol,rtn\n"
+               ":def freedroidz splitw,prevw,scratch,\"nbc-Output\",rtn,nextw,save,markk,bol,markb,prevw,prevw,blkcpy,nextw,nextw,rtn,prevw,eol,\"'\",bol,qrepl,\"'\",rtn,rtn,\"'\\\\\\\\''\",rtn,\"r\",backs,backs,backs,bol,\"LC_ALL=C; export LC_ALL; fn='\",eol,\"; p=--posix; sed $p -e q </dev/null >/dev/null 2>&1 || p=; r=$(sed $p -e 's\ 1[^^]\ 1[&]\ 1g; s\ 1\\\\^\ 1\\\\\\\\^\ 1g' <<EOF\",rtn,\"$fn\",rtn,\"EOF\",rtn,\"); (case $fn in *.nxc) ;; *) echo '==> Error: filename not *.nxc'; exit ;; esac; echo \\\"Compiling $fn\\\"; nbc -sm- -d \\\"$fn\\\" 2>&1; x=$?; if test $x = 0; then echo '==> OK'; else echo '==> Error code:' $x; fi) | tr '\\\\n' '\ 1' | sed $p -e 's!\ 1# *\\\\([^\ 1]*\\\\)\ 1File \\\"[^\\\"]*/\\\\('\\\"$r\\\"'\\\\)\\\" ; line \\\\([0-9]*\\\\)\ 1!\ 1\\\\2:\\\\3: \\\\1\ 1!g' -e 's!\ 1#\\\\([^\ 1]*\\\\)\ 1File \\\"\\\\([^\\\"]*\\\\)\\\" ; line \\\\([0-9]*\\\\)\ 1!\ 1\\\\2:\\\\3: \\\\1\ 1!g' | tr '\ 1' '\\\\n'\",rtn,nmark,filt,\"sh\",rtn,rtn,\"Press ^KQ to close this window!\",rtn,parserr\n"
                ":def docompile edit,rtn,filt,query,parserr\n"
-               "bof,qrepl,\"\\\\[\",quote,\"i\",quote,\"k\",quote,\"l\",quote,\"m ]\\\\+\\\\[\",quote,\"i\",quote,\"k\",quote,\"l\",quote,\"m ]\\\\$\",rtn,rtn,rtn,\"r\",eof   ^K ]\n"
-               "ffirst,\"\\\\^\\\\[<>=]\\\\[<>=]\\\\[<>=]\\\\[<>=]\\\\[<>=]\\\\[<>=]\\\\[<>=]\\\\[ \\\\n]\",rtn,rtn,ltarw                                                      ^Q =\n"
                "begin_marking,uparw,toggle_marking     ^[ [ 1 ; 2 A\n"
                "begin_marking,dnarw,toggle_marking     ^[ [ 1 ; 2 B\n"
                "begin_marking,rtarw,toggle_marking     ^[ [ 1 ; 2 C\n"
@@ -251,11 +256,12 @@ const unsigned char * const builtins[] = {
                "begin_marking,eol,toggle_marking       ^[ [ 1 ; 2 F\n"
                "begin_marking,bof,toggle_marking       ^[ [ 1 ; 6 H\n"
                "begin_marking,eof,toggle_marking       ^[ [ 1 ; 6 F\n"
-               ":def pastemain helpcard,\"Paste\",rtn,keymap,\"Paste\",rtn\n"
                "pastemain      ^[ P\n"
                "pastemain      ^[ p\n"
                "pastemain      ^[ [ 2 0 0 ~\n"
                "nop            ^[ [ 2 0 1 ~\n"
+               "fixwhitespace  ^K ]\n"
+               "conflictmarker ^Q =\n"
                "backs          ^?\n"
                "backs          ^H\n"
                "backw          ^[ o\n"
index f582ab9..bd4e576 100644 (file)
--- a/configure
+++ b/configure
@@ -4544,7 +4544,7 @@ else
        JUPP_WIN32RELOC=0
 
 cat >>confdefs.h <<_ACEOF
-#define JOERC "$sysconfdir$sysconfjoesubdir"
+#define JOERC "$sysconfdir$sysconfjoesubdir/"
 _ACEOF
 
 fi
index fa1f88b..adc2611 100644 (file)
@@ -1,4 +1,4 @@
-# $MirOS: contrib/code/jupp/configure.ac,v 1.65 2017/12/07 00:48:10 tg Exp $
+# $MirOS: contrib/code/jupp/configure.ac,v 1.66 2017/12/16 22:38:03 tg Exp $
 #-
 # Process this file with autoconf to produce a configure script.
 
@@ -124,7 +124,7 @@ if test x"$win32reloc" = x"yes"; then
        JUPP_WIN32RELOC=1
 else
        JUPP_WIN32RELOC=0
-       AC_DEFINE_UNQUOTED([JOERC], ["$sysconfdir$sysconfjoesubdir"], [Unix absolute paths base])
+       AC_DEFINE_UNQUOTED([JOERC], ["$sysconfdir$sysconfjoesubdir/"], [Unix absolute paths base])
 fi
 AC_DEFINE_UNQUOTED([JUPP_WIN32RELOC], [$JUPP_WIN32RELOC], [Use Win32 argv0-relative paths?])
 if test x"$win32reloc" = x"yes"; then
diff --git a/menu.c b/menu.c
index a1930e6..46cddaa 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -8,7 +8,7 @@
 #include "config.h"
 #include "types.h"
 
-__RCSID("$MirOS: contrib/code/jupp/menu.c,v 1.14 2017/12/08 02:28:05 tg Exp $");
+__RCSID("$MirOS: contrib/code/jupp/menu.c,v 1.15 2017/12/16 22:10:54 tg Exp $");
 
 #include <stdlib.h>
 #include <string.h>
@@ -349,7 +349,8 @@ static int umkey(jobject jO, int c)
                else
                        return -1;
        }
-       if (!(((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z'))))
+       c |= 0x20;
+       if (c < 'a' || c > 'z')
                return -1;
        c &= 0x1F;
        for (x = 0; x != m->nitems; ++x)
diff --git a/path.c b/path.c
index 342647d..9b940bf 100644 (file)
--- a/path.c
+++ b/path.c
@@ -8,7 +8,7 @@
 #include "config.h"
 #include "types.h"
 
-__RCSID("$MirOS: contrib/code/jupp/path.c,v 1.18 2017/12/08 02:28:05 tg Exp $");
+__RCSID("$MirOS: contrib/code/jupp/path.c,v 1.19 2017/12/16 22:10:54 tg Exp $");
 
 #include <sys/stat.h>
 #include <fcntl.h>
@@ -69,14 +69,17 @@ __RCSID("$MirOS: contrib/code/jupp/path.c,v 1.18 2017/12/08 02:28:05 tg Exp $");
 
 #if HAVE_DRIVE_LETTERS
 #define do_if_drive_letter(path, command) do {         \
-       if ((path)[1] == ':' && (                       \
-           ((path)[0] >= 'a' && (path)[0] <= 'z') ||   \
-           ((path)[0] >= 'A' && (path)[0] <= 'Z'))) {  \
-               command;                                \
+       if ((path)[1] == ':') {                         \
+               drvltrhlprv = (path)[0] | 0x20;         \
+               if (drvltrhlprv >= 'a' &&               \
+                   drvltrhlprv <= 'z')                 \
+                       command;                        \
        }                                               \
 } while (/* CONSTCOND */ 0)
+#define drvltrhlpr unsigned char drvltrhlprv
 #else
 #define do_if_drive_letter(path, command) do { } while (/* CONSTCOND */ 0)
+#define drvltrhlpr /* nothing */
 #endif
 #define skip_drive_letter(path)        do_if_drive_letter((path), (path) += 2)
 
@@ -105,6 +108,7 @@ unsigned char *joesep(unsigned char *path)
 unsigned char *namprt(unsigned char *path)
 {
        unsigned char *z;
+       drvltrhlpr;
 
        skip_drive_letter(path);
        z = path + slen(path);
@@ -116,6 +120,7 @@ unsigned char *namprt(unsigned char *path)
 unsigned char *namepart(unsigned char *tmp, unsigned char *path)
 {
        unsigned char *z;
+       drvltrhlpr;
 
        skip_drive_letter(path);
        z = path + strlen((char *)path);
@@ -129,6 +134,7 @@ unsigned char *dirprt_ptr(unsigned char *path)
 {
        unsigned char *b = path;
        unsigned char *z = path + slen(path);
+       drvltrhlpr;
 
        skip_drive_letter(b);
        while ((z != b) && (z[-1] != '/'))
@@ -144,6 +150,7 @@ unsigned char *begprt(unsigned char *path)
 {
        unsigned char *z = path + slen(path);
        int drv = 0;
+       drvltrhlpr;
 
        do_if_drive_letter(path, drv = 2);
        while ((z != path + drv) && (z[-1] == '/'))
@@ -161,6 +168,7 @@ unsigned char *endprt(unsigned char *path)
 {
        unsigned char *z = path + slen(path);
        int drv = 0;
+       drvltrhlpr;
 
        do_if_drive_letter(path, drv = 2);
        while ((z != path + drv) && (z[-1] == '/'))
diff --git a/uedit.c b/uedit.c
index 714ce25..e483e9c 100644 (file)
--- a/uedit.c
+++ b/uedit.c
@@ -8,7 +8,7 @@
 #include "config.h"
 #include "types.h"
 
-__RCSID("$MirOS: contrib/code/jupp/uedit.c,v 1.30 2017/12/08 03:24:16 tg Exp $");
+__RCSID("$MirOS: contrib/code/jupp/uedit.c,v 1.31 2017/12/16 22:10:55 tg Exp $");
 
 #include <string.h>
 
@@ -1249,7 +1249,7 @@ static int doquote(BW *bw, int c, void *object, int *notify)
                                return 0;
                } else {
  unopoo:
-                       if ((c >= 0x40 && c <= 0x5F) || (c >= 'a' && c <= 'z'))
+                       if ((c & ~0x20) >= 0x40 && (c & ~0x20) <= 0x5F)
                                c &= 0x1F;
                        if (c == '?')
                                c = 127;
@@ -1277,30 +1277,20 @@ static int doquote(BW *bw, int c, void *object, int *notify)
                break;
        case 3:
                if (c >= '0' && c <= '9') {
-                       joe_snprintf_1((char *)buf, sizeof(buf), "ASCII 0x%c-", c);
                        quoteval = c - '0';
-                       quotestate = 4;
-                       if (!mkqwna(bw->parent, sz(buf), doquote, NULL, NULL, notify))
-                               return -1;
-                       else
-                               return 0;
-               } else if (c >= 'a' && c <= 'f') {
-                       joe_snprintf_1((char *)buf, sizeof(buf), "ASCII 0x%c-", c + 'A' - 'a');
-                       quoteval = c - 'a' + 10;
-                       quotestate = 4;
-                       if (!mkqwna(bw->parent, sz(buf), doquote, NULL, NULL, notify))
-                               return -1;
-                       else
-                               return 0;
-               } else if (c >= 'A' && c <= 'F') {
+ uhex_3:
                        joe_snprintf_1((char *)buf, sizeof(buf), "ASCII 0x%c-", c);
-                       quoteval = c - 'A' + 10;
                        quotestate = 4;
                        if (!mkqwna(bw->parent, sz(buf), doquote, NULL, NULL, notify))
                                return -1;
                        else
                                return 0;
                }
+               c &= ~0x20;
+               if (c >= 'A' && c <= 'F') {
+                       quoteval = c - 'A' + 10;
+                       goto uhex_3;
+               }
                break;
        case 4:
                if (c >= '0' && c <= '9') {
@@ -1370,7 +1360,7 @@ static int doquote9(BW *bw, int c, void *object, int *notify)
 {
        if (notify)
                *notify = 1;
-       if ((c >= 0x40 && c <= 0x5F) || (c >= 'a' && c <= 'z'))
+       if ((c & ~0x20) >= 0x40 && (c & ~0x20) <= 0x5F)
                c &= 0x1F;
        if (c == '?')
                c = 127;
diff --git a/umath.c b/umath.c
index f2ea4c9..4063ce7 100644 (file)
--- a/umath.c
+++ b/umath.c
@@ -8,7 +8,7 @@
 #include "config.h"
 #include "types.h"
 
-__RCSID("$MirOS: contrib/code/jupp/umath.c,v 1.24 2017/12/08 02:28:08 tg Exp $");
+__RCSID("$MirOS: contrib/code/jupp/umath.c,v 1.25 2017/12/16 22:10:55 tg Exp $");
 
 #include <stdlib.h>
 #include <string.h>
@@ -66,21 +66,20 @@ struct var *dumb;
 
 static double expr(int prec, struct var **rtv)
 {
+       unsigned char c;
        double x = 0.0;
        struct var *v = NULL;
 
        while (*ptr == ' ' || *ptr == '\t') {
                ++ptr;
        }
-       if ((*ptr >= 'a' && *ptr <= 'z') || (*ptr >= 'A' && *ptr <= 'Z')
-           || *ptr == '_') {
-               unsigned char *s = ptr, c;
+       c = *ptr | 0x20;
+       if ((c >= 'a' && c <= 'z') || *ptr == '_') {
+               unsigned char *s = ptr;
 
-               while ((*ptr >= 'a' && *ptr <= 'z')
-                      || (*ptr >= 'A' && *ptr <= 'Z')
-                      || *ptr == '_' || (*ptr >= '0' && *ptr <= '9')) {
+               while (((c = *ptr | 0x20) >= 'a' && c <= 'z') ||
+                   *ptr == '_' || (*ptr >= '0' && *ptr <= '9'))
                        ++ptr;
-               }
                c = *ptr;
                *ptr = 0;
                v = get(s);
index 3e3342e..b662bfb 100644 (file)
--- a/usearch.c
+++ b/usearch.c
@@ -8,7 +8,7 @@
 #include "config.h"
 #include "types.h"
 
-__RCSID("$MirOS: contrib/code/jupp/usearch.c,v 1.20 2017/12/08 02:00:43 tg Exp $");
+__RCSID("$MirOS: contrib/code/jupp/usearch.c,v 1.21 2017/12/16 22:10:55 tg Exp $");
 
 #include <stdlib.h>
 
@@ -447,7 +447,7 @@ static P *insert(SRCH *srch, P *p, unsigned char *s, int len)
                        len -= x;
                        s += x;
                } else if (len >= 2) {
-                       if (((s[1] >= 'a' && s[1] <= 'z') || (s[1] >= 'A' && s[1] <= 'Z')) &&
+                       if (((s[1] | 0x20) >= 'a' && (s[1] | 0x20) <= 'z') &&
                            srch->pieces[(s[1] & 0x1f) - 1]) {
                                binsm(p, sv(srch->pieces[(s[1] & 0x1f) - 1]));
                                pfwrd(p, (long) sLEN(srch->pieces[(s[1] & 0x1f) - 1]));