Skip to content

Commit

Permalink
Merge pull request #1012 from xexyl/bug-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lcn2 authored Oct 31, 2024
2 parents 0fce9c6 + a1c5ecb commit 66ed095
Show file tree
Hide file tree
Showing 42 changed files with 1,216 additions and 3,310 deletions.
20 changes: 20 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
# Major changes to the IOCCC entry toolkit


## Release 1.6.3 2024-10-31

Sync the `jparse/` directory from [jparse
repo](https://github.com/xexyl/jparse/). This includes some important bug fixes,
including a segfault when JSON debug level was specified and a string was
encountered (the problem was that when `has_nul` was removed it the format
specifier, a `%s`, was not removed).

A more significant change (that only requires minor changes in mkiocccentry
code) is that the tools `jstrencode(1)` and `jstrdecode(1)` were swapped as
according to other sources, converting a code point to another character
(accented character, emoji etc.) is encoding, not decoding. This means that
functions and comments were also changed. Only minor changes in this repo had to
be made, as noted, however and specifically function name changes.

With this merged the temp-test-ioccc repo will have to have the scripts updated
to use the right tool (not jstrdecode but jstrencode) and the correct version
(2.0.0).


## Release 1.6.2 2024-10-30

Sync the `jparse/` directory from [jparse
Expand Down
23 changes: 23 additions & 0 deletions jparse/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# Significant changes in the JSON parser repo

## Release 2.0.0 2024-10-31

Major release. The tools `jstrencode(1)` and `jstrdecode(1)` have been swapped
as converting a code point to (say) an emoji is actually encoding, not decoding,
according to other sources. Most places that referred to encode were changed to
decode and those that were decode are now encode. This major change is quite
unfortunate but was deemed necessary; as we have said: sorry (tm Canada :-) ).

The version of the repo, the UTF-8 library, the jparse library, `jstrencode(1)`,
`jstrdecode(1)` have all been updated to `"2.0.0 2024-10-31"`.

Some duplicate man pages in `man/man3` are now symlinks to the source file,
`jparse.3`. This happened when the initial import to this repo occurred. Also,
the man pages for `jstrdecode` and `jstrencode` were swapped as well as fixed
(the terms were incorrect in those man pages wrt the tool).

Improve `jparse_bug_report.sh` for easier parsing. The script now quotes what is
about to be executed / what was executed. A few other changes were made and the
TOOLS variable was sorted as it should have been.

Fix segfault in `jparse -J level` when acting on strings.


## Release 1.2.9 2024-10-30

Add function `utf8decode()` (from the same location as the `utf8encode()` but
Expand Down
28 changes: 14 additions & 14 deletions jparse/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ CFLAGS= ${C_STD} ${C_OPT} ${WARN_FLAGS} ${C_SPECIAL} ${LDFLAGS}
# source files that are permanent (not made, nor removed)
#
C_SRC= jparse_main.c json_parse.c json_sem.c json_util.c \
jsemtblgen.c jstrdecode.c jstrencode.c util.c verge.c jstr_util.c
jsemtblgen.c jstrencode.c jstrdecode.c util.c verge.c jstr_util.c
H_SRC= jparse.h jparse_main.h jsemtblgen.h json_parse.h json_sem.h json_util.h \
jstrdecode.h jstrencode.h sorry.tm.ca.h util.h verge.h jparse.tab.ref.h \
jstrencode.h jstrdecode.h sorry.tm.ca.h util.h verge.h jparse.tab.ref.h \
jstr_util.h version.h

# source files that do not conform to strict picky standards
Expand All @@ -234,7 +234,7 @@ SH_FILES= jsemcgen.sh run_bison.sh run_flex.sh jparse_bug_report.sh

# all man pages that NOT built and NOT removed by make clobber
#
MAN1_PAGES= man/man1/jparse.1 man/man1/jstrdecode.1 man/man1/jstrencode.1 man/man1/jparse_bug_report.1
MAN1_PAGES= man/man1/jparse.1 man/man1/jstrencode.1 man/man1/jstrdecode.1 man/man1/jparse_bug_report.1
MAN3_PAGES= man/man3/jparse.3 man/man3/json_dbg.3 man/man3/json_dbg_allowed.3 \
man/man3/json_err_allowed.3 man/man3/json_warn_allowed.3 man/man3/parse_json.3 \
man/man3/parse_json_file.3 man/man3/parse_json_stream.3
Expand Down Expand Up @@ -265,7 +265,7 @@ LIB_OBJS= jparse.o jparse.tab.o json_parse.o json_sem.o json_util.o util.o json_

# NOTE: ${OTHER_OBJS} are objects NOT put into a library and ARE removed by make clean
#
OTHER_OBJS= verge.o jsemtblgen.o jstrdecode.o jstrencode.o jparse_main.o
OTHER_OBJS= verge.o jsemtblgen.o jstrencode.o jstrdecode.o jparse_main.o

# all intermediate files which are also removed by make clean
#
Expand Down Expand Up @@ -374,7 +374,7 @@ EXTERN_H= jparse.h
EXTERN_O=
EXTERN_MAN= ${ALL_MAN_TARGETS}
EXTERN_LIBA= libjparse.a
EXTERN_PROG= jparse jsemtblgen jsemcgen.sh jstrdecode jstrencode
EXTERN_PROG= jparse jsemtblgen jsemcgen.sh jstrencode jstrdecode

# NOTE: ${EXTERN_CLOBBER} used outside of this directory and removed by make clobber
#
Expand Down Expand Up @@ -402,7 +402,7 @@ SH_TARGETS=

# program targets to make by all, installed by install, and removed by clobber
#
PROG_TARGETS= jparse verge jsemtblgen jstrdecode jstrencode
PROG_TARGETS= jparse verge jsemtblgen jstrencode jstrdecode

# include files NOT to removed by clobber
#
Expand Down Expand Up @@ -503,19 +503,19 @@ jparse: jparse_main.o libjparse.a
jstr_util.o: jstr_util.c jstr_util.h
${CC} ${CFLAGS} jstr_util.c -c

jstrencode.o: jstrencode.c jstrencode.h json_util.h json_util.c json_utf8.h version.h
${CC} ${CFLAGS} jstrencode.c -c
jstrdecode.o: jstrdecode.c jstrdecode.h json_util.h json_util.c json_utf8.h version.h
${CC} ${CFLAGS} jstrdecode.c -c

jstrencode: jstrencode.o libjparse.a jstr_util.o
jstrdecode: jstrdecode.o libjparse.a jstr_util.o
${CC} ${CFLAGS} $^ -lm -o $@ ${LD_DIR} -ldbg -ldyn_array

json_utf8.o: json_utf8.c json_utf8.h
${CC} ${CFLAGS} json_utf8.c -c

jstrdecode.o: jstrdecode.c jstrdecode.h json_util.h json_parse.h json_utf8.h version.h
${CC} ${CFLAGS} jstrdecode.c -c
jstrencode.o: jstrencode.c jstrencode.h json_util.h json_parse.h json_utf8.h version.h
${CC} ${CFLAGS} jstrencode.c -c

jstrdecode: jstrdecode.o libjparse.a jstr_util.o
jstrencode: jstrencode.o libjparse.a jstr_util.o
${CC} ${CFLAGS} $^ -lm -o $@ ${LD_DIR} -ldbg -ldyn_array

json_parse.o: json_parse.c
Expand Down Expand Up @@ -1179,15 +1179,15 @@ uninstall: legacy_uninstall
${Q} ${RM} ${RM_V} -f ${DEST_DIR}/jparse
${Q} ${RM} ${RM_V} -f ${DEST_DIR}/verge
${Q} ${RM} ${RM_V} -f ${DEST_DIR}/jsemtblgen
${Q} ${RM} ${RM_V} -f ${DEST_DIR}/jstrdecode
${Q} ${RM} ${RM_V} -f ${DEST_DIR}/jstrencode
${Q} ${RM} ${RM_V} -f ${DEST_DIR}/jstrdecode
${Q} ${RM} ${RM_V} -f ${DEST_DIR}/jsemcgen.sh
${Q} ${RM} ${RM_V} -f ${DEST_DIR}/run_bison.sh
${Q} ${RM} ${RM_V} -f ${DEST_DIR}/run_flex.sh
${Q} ${RM} ${RM_V} -f ${MAN1_DIR}/jparse_bug_report.1
${Q} ${RM} ${RM_V} -f ${MAN1_DIR}/jparse.1
${Q} ${RM} ${RM_V} -f ${MAN1_DIR}/jstrdecode.1
${Q} ${RM} ${RM_V} -f ${MAN1_DIR}/jstrencode.1
${Q} ${RM} ${RM_V} -f ${MAN1_DIR}/jstrdecode.1
${Q} ${RM} ${RM_V} -f ${MAN3_DIR}/jparse.3
${Q} ${RM} ${RM_V} -f ${MAN3_DIR}/json_dbg.3
${Q} ${RM} ${RM_V} -f ${MAN3_DIR}/json_dbg_allowed.3
Expand Down
Loading

0 comments on commit 66ed095

Please sign in to comment.