summaryrefslogtreecommitdiff
path: root/src/json.c
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@linux-m68k.org>2020-10-05 19:59:00 +0200
committerAndreas Schwab <schwab@linux-m68k.org>2020-10-05 20:19:59 +0200
commita9f147af716aa026ec7778202901c4cb4bd5487d (patch)
tree221b3d26599d09f5af906d15544ebeb8ed788028 /src/json.c
parent0a5a1adab986de39a147771b8f9aa21656ecc001 (diff)
downloademacs-a9f147af716aa026ec7778202901c4cb4bd5487d.tar.gz
emacs-a9f147af716aa026ec7778202901c4cb4bd5487d.tar.bz2
emacs-a9f147af716aa026ec7778202901c4cb4bd5487d.zip
Use the full name of the null byte/character, not its abbreviation
* lisp/subr.el (inhibit-nul-byte-detection): Make it an obsolete alias. * src/coding.c (setup_coding_system): Use original name. (detect_coding): Rename nul_byte_found => null_byte_found. (detect_coding_system): Use original name. Rename nul_byte_found => null_byte_found. (Fdefine_coding_system_internal): Use original name. (syms_of_coding): Rename inhibit-nul-byte-detection to inhibit-null-byte-detection. * src/w16select.c (get_clipboard_data): Rename nul_char to null_char. * src/json.c (check_string_without_embedded_nulls): Rename from check_string_without_embedded_nuls. (Fjson_parse_string): Adjust accordingly. * src/coding.h (enum define_coding_undecided_arg_index) (enum coding_attr_index): Rename ...nul_byte... to ...null_byte.... * lisp/info.el (info-insert-file-contents, Info-insert-dir): * lisp/international/mule.el (define-coding-system): * lisp/vc/vc-git.el (vc-git--call): * doc/lispref/nonascii.texi (Lisp and Coding Systems): Use original name.
Diffstat (limited to 'src/json.c')
-rw-r--r--src/json.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/json.c b/src/json.c
index 8c9583631ad..744c40a1bef 100644
--- a/src/json.c
+++ b/src/json.c
@@ -279,10 +279,10 @@ json_release_object (void *object)
}
/* Signal an error if OBJECT is not a string, or if OBJECT contains
- embedded NUL characters. */
+ embedded null characters. */
static void
-check_string_without_embedded_nuls (Lisp_Object object)
+check_string_without_embedded_nulls (Lisp_Object object)
{
CHECK_STRING (object);
CHECK_TYPE (memchr (SDATA (object), '\0', SBYTES (object)) == NULL,
@@ -368,11 +368,11 @@ lisp_to_json_toplevel_1 (Lisp_Object lisp,
CHECK_STRING (key);
Lisp_Object ekey = json_encode (key);
/* We can't specify the length, so the string must be
- NUL-terminated. */
- check_string_without_embedded_nuls (ekey);
+ null-terminated. */
+ check_string_without_embedded_nulls (ekey);
const char *key_str = SSDATA (ekey);
/* Reject duplicate keys. These are possible if the hash
- table test is not `equal'. */
+ table test is not `equal'. */
if (json_object_get (json, key_str) != NULL)
wrong_type_argument (Qjson_value_p, lisp);
int status
@@ -419,8 +419,8 @@ lisp_to_json_toplevel_1 (Lisp_Object lisp,
CHECK_SYMBOL (key_symbol);
Lisp_Object key = SYMBOL_NAME (key_symbol);
/* We can't specify the length, so the string must be
- NUL-terminated. */
- check_string_without_embedded_nuls (key);
+ null-terminated. */
+ check_string_without_embedded_nulls (key);
key_str = SSDATA (key);
/* In plists, ensure leading ":" in keys is stripped. It
will be reconstructed later in `json_to_lisp'.*/
@@ -563,7 +563,7 @@ false values, t, numbers, strings, or other vectors hashtables, alists
or plists. t will be converted to the JSON true value. Vectors will
be converted to JSON arrays, whereas hashtables, alists and plists are
converted to JSON objects. Hashtable keys must be strings without
-embedded NUL characters and must be unique within each object. Alist
+embedded null characters and must be unique within each object. Alist
and plist keys must be symbols; if a key is duplicate, the first
instance is used.
@@ -976,7 +976,7 @@ usage: (json-parse-string STRING &rest ARGS) */)
Lisp_Object string = args[0];
CHECK_STRING (string);
Lisp_Object encoded = json_encode (string);
- check_string_without_embedded_nuls (encoded);
+ check_string_without_embedded_nulls (encoded);
struct json_configuration conf =
{json_object_hashtable, json_array_array, QCnull, QCfalse};
json_parse_args (nargs - 1, args + 1, &conf, true);