summaryrefslogtreecommitdiff
path: root/src/w32.c
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2019-03-21 23:55:28 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2019-03-21 23:55:28 -0400
commit76fea1eba1332440eab2e3daecce053daccd3782 (patch)
tree944ea8279b8a52cb715fe3493d909bc581776430 /src/w32.c
parent57a60db2b88dfa5dea41a3a05b736cd7cd17a953 (diff)
downloademacs-76fea1eba1332440eab2e3daecce053daccd3782.tar.gz
Fix misuses of NULL when talking about the NUL character
* lisp/subr.el (inhibit-null-byte-detection): Make it an obsolete alias. * src/coding.c (setup_coding_system): Use new name. (detect_coding): Rename null_byte_found => nul_byte_found. (detect_coding_system): Use new name. Rename null_byte_found => nul_byte_found. (Fdefine_coding_system_internal): Use new name. (syms_of_coding): Rename inhibit-null-byte-detection to inhibit-nul-byte-detection. * src/w16select.c (get_clipboard_data): null_char => nul_char. * src/json.c (check_string_without_embedded_nuls): Rename from check_string_without_embedded_nulls. (Fjson_parse_string): Adjust accordingly. * src/coding.h (enum define_coding_undecided_arg_index) (enum coding_attr_index): ...null_byte... => ...nul_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 the new name.
Diffstat (limited to 'src/w32.c')
-rw-r--r--src/w32.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/w32.c b/src/w32.c
index f3e88afd5bf..082a66b7384 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -5941,7 +5941,7 @@ is_symlink (const char *filename)
/* If NAME identifies a symbolic link, copy into BUF the file name of
the symlink's target. Copy at most BUF_SIZE bytes, and do NOT
- null-terminate the target name, even if it fits. Return the number
+ NUL-terminate the target name, even if it fits. Return the number
of bytes copied, or -1 if NAME is not a symlink or any error was
encountered while resolving it. The file name copied into BUF is
encoded in the current ANSI codepage. */
@@ -6045,10 +6045,10 @@ readlink (const char *name, char *buf, size_t buf_size)
size_t size_to_copy = buf_size;
/* According to MSDN, PrintNameLength does not include the
- terminating null character. */
+ terminating NUL character. */
lwname = alloca ((lwname_len + 1) * sizeof(WCHAR));
memcpy (lwname, lwname_src, lwname_len);
- lwname[lwname_len/sizeof(WCHAR)] = 0; /* null-terminate */
+ lwname[lwname_len/sizeof(WCHAR)] = 0; /* NUL-terminate */
filename_from_utf16 (lwname, resolved);
dostounix_filename (resolved);
lname_size = strlen (resolved) + 1;
@@ -9384,7 +9384,7 @@ w32_read_registry (HKEY rootkey, Lisp_Object lkey, Lisp_Object lname)
/* Convert input strings to UTF-16. */
encoded_key = code_convert_string_norecord (lkey, Qutf_16le, 1);
memcpy (key_w, SSDATA (encoded_key), SBYTES (encoded_key));
- /* wchar_t strings need to be terminated by 2 null bytes. */
+ /* wchar_t strings need to be terminated by 2 NUL bytes. */
key_w [SBYTES (encoded_key)/2] = L'\0';
encoded_vname = code_convert_string_norecord (lname, Qutf_16le, 1);
memcpy (value_w, SSDATA (encoded_vname), SBYTES (encoded_vname));
@@ -9476,7 +9476,7 @@ w32_read_registry (HKEY rootkey, Lisp_Object lkey, Lisp_Object lname)
case REG_SZ:
if (use_unicode)
{
- /* pvalue ends with 2 null bytes, but we need only one,
+ /* pvalue ends with 2 NUL bytes, but we need only one,
and AUTO_STRING_WITH_LEN will add it. */
if (pvalue[vsize - 1] == '\0')
vsize -= 2;
@@ -9485,7 +9485,7 @@ w32_read_registry (HKEY rootkey, Lisp_Object lkey, Lisp_Object lname)
}
else
{
- /* Don't waste a byte on the terminating null character,
+ /* Don't waste a byte on the terminating NUL character,
since make_unibyte_string will add one anyway. */
if (pvalue[vsize - 1] == '\0')
vsize--;