Fixed backslash and quotes processing in strings.
h3rald h3rald@h3rald.com
Wed, 11 Dec 2024 18:26:15 +0100
3 files changed,
7 insertions(+),
7 deletions(-)
M
scripts/test.hex
→
scripts/test.hex
@@ -220,6 +220,7 @@ ((0x4 0x4 get) (error) try "Symbol 'get' requires a quotation or a string" ==)
;120 ("a/b/c" "t-path" : (t-path "/" index 0x0 >=) (t-path "/" "\\" replace "t-path" :) while t-path "a\\b\\c" == "t-path" #) + ("assets\"" "\"" "/" replace "assets/" ==) ) "tests" :
M
scripts/web.hex
→
scripts/web.hex
@@ -103,7 +103,6 @@ ; Process home page
d-out "/index.html" cat "dst-file" : ) ( - ("sh -c \"mkdir -p " d-out "/" id-content "\"") () map "" join exec (d-out id-content "index.html") () map "/" join "dst-file" : ) if@@ -113,7 +112,7 @@ ) each
; Write assets -("sh -c \"mkdir -p " d-out "/assets\"") () map "" join exec +("sh -c \"mkdir -p " d-out "/assets\"") () map "" join exec assets ( "fn-asset" :
M
src/hex.c
→
src/hex.c
@@ -669,15 +669,15 @@
ptr = start; while (*ptr != '\0' && *ptr != '"') { - if (*ptr == '\\' && *(ptr + 1) == '"') - { - *dst++ = '"'; - ptr += 2; - } if (*ptr == '\\' && *(ptr + 1) == '\\') { *dst++ = '\\'; *dst++ = '\\'; + ptr += 2; + } + else if (*ptr == '\\' && *(ptr + 1) == '"') + { + *dst++ = '"'; ptr += 2; } else