diff --git a/GNUmakefile b/GNUmakefile index 83b8b65..925609c 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -225,7 +225,7 @@ install-man: install -d $(DESTDIR)$(MAN3DIR) install -m 644 $(wildcard */*.3) $(DESTDIR)$(MAN3DIR) -install: install-inc install-man install-lib +install: headers install-inc install-man install-lib uninstall: rm -f $(patsubst %.h,$(INCLUDEDIR)/%.h,$(INCLUDES)) diff --git a/textcode/scan_jsonescape.c b/textcode/scan_jsonescape.c index 7fb8b41..0ba88b8 100644 --- a/textcode/scan_jsonescape.c +++ b/textcode/scan_jsonescape.c @@ -11,6 +11,9 @@ size_t scan_jsonescape(const char *src,char *dest,size_t *destlen) { for (i=0; s[i]; ++i) { if ((c=s[i])=='\\') { switch (s[i+1]) { + case '"': + if (prev!=(unsigned int)-1) return 0; // lead surrogate not followed by tail surrogate + goto done; case '\\': if (prev!=(unsigned int)-1) return 0; // lead surrogate not followed by tail surrogate // c='\\'; // c already is backslash @@ -54,6 +57,7 @@ size_t scan_jsonescape(const char *src,char *dest,size_t *destlen) { if (dest) dest[written]=c; ++written; } +done: *destlen=written; return i; }