From: Lady Date: Sun, 28 Apr 2024 03:46:11 +0000 (-0400) Subject: Fix X·M·L 1.1 handling to be portable X-Git-Tag: 0.7.3^0 X-Git-Url: https://git.ladys.computer/Shushe/commitdiff_plain/beb39322e5c5b6885ecf64b5dfebb27628801c87 Fix X·M·L 1.1 handling to be portable A typo meant it was calling `PRINTF` instead of `printf`; amazingly, the built·in seems to be case‐insensitive on Macintosh so it wasn’t noticed. --- diff --git a/GNUmakefile b/GNUmakefile index da2912d..ab4bfb0 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -458,7 +458,7 @@ override wrapplaintext = $(TR) '\000\013\014' '\032\011\012' < $(call quote,$1) # The X·M·L declaration will be dropped and character escapes for C0 control codes will be replaced with a literal `U+0091 PRIVATE USE ONE´, which is invalid in X·M·L 1.1, but valid X·M·L 1.0 (making the replacement obvious). # # This isn’t a perfect substitution (it makes some assumptions about the format of the underlying X·M·L), but it should be workable for most sensible, welformed files. -override serializexml = $(SED) "$$($(PRINTF) '%b' '/]*?>//\n s/&\0043x0*[1-8BCEFbcef];/\0302\0221/g\n s/&\0043x0*1[0-9A-Fa-f];/\0302\0221/g\n s/&\00430*[1-8];/\0302\0221/g\n s/&\00430*1[124-9];/\0302\0221/g\n s/&\00430*2[0-9];/\0302\0221/g\n s/&\00430*3[01];/\0302\0221/g\n}')" < $(call quote,$1) | $(SED) "$$(PRINTF '%b' ':a\n/^\\n*$$/{ $$d\n N\n ba\n}')" +override serializexml = $(SED) "$$($(PRINTF) '%b' '/]*?>//\n s/&\0043x0*[1-8BCEFbcef];/\0302\0221/g\n s/&\0043x0*1[0-9A-Fa-f];/\0302\0221/g\n s/&\00430*[1-8];/\0302\0221/g\n s/&\00430*1[124-9];/\0302\0221/g\n s/&\00430*2[0-9];/\0302\0221/g\n s/&\00430*3[01];/\0302\0221/g\n}')" < $(call quote,$1) | $(SED) "$$($(PRINTF) '%b' ':a\n/^\\n*$$/{ $$d\n N\n ba\n}')" # ─ ¶ Phony Targets ───────────────────────────────────────────────────