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.
This commit is contained in:
parent
0a5a1adab9
commit
a9f147af71
40 changed files with 128 additions and 126 deletions
|
@ -548,7 +548,7 @@ the functions in the list @code{after-insert-file-functions}.
|
|||
(@pxref{Coding Systems}) used for decoding the file's contents,
|
||||
including end-of-line conversion. However, if the file contains null
|
||||
bytes, it is by default visited without any code conversions.
|
||||
@xref{Lisp and Coding Systems, inhibit-nul-byte-detection}.
|
||||
@xref{Lisp and Coding Systems, inhibit-null-byte-detection}.
|
||||
|
||||
If @var{visit} is non-@code{nil}, this function additionally marks the
|
||||
buffer as unmodified and sets up various fields in the buffer so that it
|
||||
|
|
|
@ -1379,7 +1379,7 @@ operates on the contents of @var{string} instead of bytes in the buffer.
|
|||
@end defun
|
||||
|
||||
@cindex null bytes, and decoding text
|
||||
@defvar inhibit-nul-byte-detection
|
||||
@defvar inhibit-null-byte-detection
|
||||
If this variable has a non-@code{nil} value, null bytes are ignored
|
||||
when detecting the encoding of a region or a string. This allows the
|
||||
encoding of text that contains null bytes to be correctly detected,
|
||||
|
|
|
@ -1839,7 +1839,7 @@ system comes from @code{coding-system-for-read}, if that is
|
|||
non-@code{nil}; or else from the defaulting mechanism (@pxref{Default
|
||||
Coding Systems}). If the text output by a process contains null
|
||||
bytes, Emacs by default uses @code{no-conversion} for it; see
|
||||
@ref{Lisp and Coding Systems, inhibit-nul-byte-detection}, for how to
|
||||
@ref{Lisp and Coding Systems, inhibit-null-byte-detection}, for how to
|
||||
control this behavior.
|
||||
|
||||
@strong{Warning:} Coding systems such as @code{undecided}, which
|
||||
|
|
2
etc/NEWS
2
etc/NEWS
|
@ -1621,6 +1621,8 @@ convert them to a list '(R G B)' of primary color values.
|
|||
This user option can be one of the predefined styles or a function to
|
||||
personalize the uniquified buffer name.
|
||||
|
||||
+++
|
||||
** 'inhibit-nul-byte-detection' is renamed to 'inhibit-null-byte-detection'.
|
||||
|
||||
|
||||
* Changes in Emacs 28.1 on Non-Free Operating Systems
|
||||
|
|
|
@ -638,14 +638,14 @@ Do the right thing if the file has been compressed or zipped."
|
|||
(insert-file-contents-literally fullname visit)
|
||||
(let ((inhibit-read-only t)
|
||||
(coding-system-for-write 'no-conversion)
|
||||
(inhibit-nul-byte-detection t) ; Index nodes include null bytes
|
||||
(inhibit-null-byte-detection t) ; Index nodes include null bytes
|
||||
(default-directory (or (file-name-directory fullname)
|
||||
default-directory)))
|
||||
(or (consp decoder)
|
||||
(setq decoder (list decoder)))
|
||||
(apply #'call-process-region (point-min) (point-max)
|
||||
(car decoder) t t nil (cdr decoder))))
|
||||
(let ((inhibit-nul-byte-detection t)) ; Index nodes include null bytes
|
||||
(let ((inhibit-null-byte-detection t)) ; Index nodes include null bytes
|
||||
(insert-file-contents fullname visit)))
|
||||
|
||||
;; Clear the caches of modified Info files.
|
||||
|
@ -1375,7 +1375,7 @@ is non-nil)."
|
|||
;; Index nodes include null bytes. DIR
|
||||
;; files should not have indices, but who
|
||||
;; knows...
|
||||
(let ((inhibit-nul-byte-detection t))
|
||||
(let ((inhibit-null-byte-detection t))
|
||||
(insert-file-contents file)
|
||||
(setq Info-dir-file-name file)
|
||||
(push (current-buffer) buffers)
|
||||
|
|
|
@ -855,10 +855,10 @@ VALUE is a CCL program name defined by `define-ccl-program'. The
|
|||
CCL program reads a character sequence and writes a byte sequence
|
||||
as an encoding result.
|
||||
|
||||
`:inhibit-nul-byte-detection'
|
||||
`:inhibit-null-byte-detection'
|
||||
|
||||
VALUE non-nil means Emacs ignore null bytes on code detection.
|
||||
See the variable `inhibit-nul-byte-detection'. This attribute
|
||||
See the variable `inhibit-null-byte-detection'. This attribute
|
||||
is meaningful only when `:coding-type' is `undecided'.
|
||||
|
||||
`:inhibit-iso-escape-detection'
|
||||
|
@ -903,7 +903,7 @@ non-ASCII files. This attribute is meaningful only when
|
|||
:ccl-encoder
|
||||
:valids))
|
||||
((eq coding-type 'undecided)
|
||||
'(:inhibit-nul-byte-detection
|
||||
'(:inhibit-null-byte-detection
|
||||
:inhibit-iso-escape-detection
|
||||
:prefer-utf-8))))))
|
||||
|
||||
|
@ -956,8 +956,8 @@ non-ASCII files. This attribute is meaningful only when
|
|||
(cons :name (cons name (cons :docstring (cons (purecopy docstring)
|
||||
props)))))
|
||||
(setcdr (assq :plist common-attrs) props)
|
||||
(apply #'define-coding-system-internal
|
||||
name (mapcar #'cdr (append common-attrs spec-attrs)))))
|
||||
(apply 'define-coding-system-internal
|
||||
name (mapcar 'cdr (append common-attrs spec-attrs)))))
|
||||
|
||||
(defun coding-system-doc-string (coding-system)
|
||||
"Return the documentation string for CODING-SYSTEM."
|
||||
|
|
|
@ -1622,8 +1622,8 @@ be a list of the form returned by `event-start' and `event-end'."
|
|||
(make-obsolete-variable 'x-gtk-use-window-move nil "26.1")
|
||||
|
||||
(defvaralias 'messages-buffer-max-lines 'message-log-max)
|
||||
(define-obsolete-variable-alias 'inhibit-null-byte-detection
|
||||
'inhibit-nul-byte-detection "27.1")
|
||||
(define-obsolete-variable-alias 'inhibit-nul-byte-detection
|
||||
'inhibit-null-byte-detection "28.1")
|
||||
(make-obsolete-variable 'load-dangerous-libraries
|
||||
"no longer used." "27.1")
|
||||
|
||||
|
|
|
@ -1795,9 +1795,9 @@ The difference to vc-do-command is that this function always invokes
|
|||
(defun vc-git--call (buffer command &rest args)
|
||||
;; We don't need to care the arguments. If there is a file name, it
|
||||
;; is always a relative one. This works also for remote
|
||||
;; directories. We enable `inhibit-nul-byte-detection', otherwise
|
||||
;; directories. We enable `inhibit-null-byte-detection', otherwise
|
||||
;; Tramp's eol conversion might be confused.
|
||||
(let ((inhibit-nul-byte-detection t)
|
||||
(let ((inhibit-null-byte-detection t)
|
||||
(coding-system-for-read
|
||||
(or coding-system-for-read vc-git-log-output-coding-system))
|
||||
(coding-system-for-write
|
||||
|
|
|
@ -1658,7 +1658,7 @@ sdata_size (ptrdiff_t n)
|
|||
#define GC_STRING_EXTRA GC_STRING_OVERRUN_COOKIE_SIZE
|
||||
|
||||
/* Exact bound on the number of bytes in a string, not counting the
|
||||
terminating NUL. A string cannot contain more bytes than
|
||||
terminating null. A string cannot contain more bytes than
|
||||
STRING_BYTES_BOUND, nor can it be so long that the size_t
|
||||
arithmetic in allocate_string_data would overflow while it is
|
||||
calculating a value to be passed to malloc. */
|
||||
|
|
|
@ -2338,7 +2338,7 @@ bidi_resolve_weak (struct bidi_it *bidi_it)
|
|||
and make it L right away, to avoid the
|
||||
potentially costly loop below. This is
|
||||
important when the buffer has a long series of
|
||||
control characters, like binary NULs, and no
|
||||
control characters, like binary nulls, and no
|
||||
R2L characters at all. */
|
||||
&& new_level == 0
|
||||
&& !bidi_explicit_dir_char (bidi_it->ch)
|
||||
|
@ -2996,7 +2996,7 @@ bidi_resolve_neutral (struct bidi_it *bidi_it)
|
|||
}
|
||||
/* The next two "else if" clauses are shortcuts for the
|
||||
important special case when we have a long sequence of
|
||||
neutral or WEAK_BN characters, such as whitespace or NULs or
|
||||
neutral or WEAK_BN characters, such as whitespace or nulls or
|
||||
other control characters, on the base embedding level of the
|
||||
paragraph, and that sequence goes all the way to the end of
|
||||
the paragraph and follows a character whose resolved
|
||||
|
|
|
@ -353,7 +353,7 @@ emacs_mpz_pow_ui (mpz_t rop, mpz_t const base, unsigned long exp)
|
|||
|
||||
/* Yield an upper bound on the buffer size needed to contain a C
|
||||
string representing the NUM in base BASE. This includes any
|
||||
preceding '-' and the terminating NUL. */
|
||||
preceding '-' and the terminating null. */
|
||||
static ptrdiff_t
|
||||
mpz_bufsize (mpz_t const num, int base)
|
||||
{
|
||||
|
@ -418,7 +418,7 @@ bignum_to_string (Lisp_Object num, int base)
|
|||
|
||||
/* Create a bignum by scanning NUM, with digits in BASE.
|
||||
NUM must consist of an optional '-', a nonempty sequence
|
||||
of base-BASE digits, and a terminating NUL byte, and
|
||||
of base-BASE digits, and a terminating null byte, and
|
||||
the represented number must not be in fixnum range. */
|
||||
|
||||
Lisp_Object
|
||||
|
|
|
@ -712,7 +712,7 @@ invoke it (via an `interactive' spec that contains, for instance, an
|
|||
default:
|
||||
{
|
||||
/* How many bytes are left unprocessed in the specs string?
|
||||
(Note that this excludes the trailing NUL byte.) */
|
||||
(Note that this excludes the trailing null byte.) */
|
||||
ptrdiff_t bytes_left = string_len - (tem - string);
|
||||
unsigned letter;
|
||||
|
||||
|
|
60
src/coding.c
60
src/coding.c
|
@ -5707,7 +5707,7 @@ setup_coding_system (Lisp_Object coding_system, struct coding_system *coding)
|
|||
coding->common_flags |= CODING_REQUIRE_DETECTION_MASK;
|
||||
coding->spec.undecided.inhibit_nbd
|
||||
= (encode_inhibit_flag
|
||||
(AREF (attrs, coding_attr_undecided_inhibit_nul_byte_detection)));
|
||||
(AREF (attrs, coding_attr_undecided_inhibit_null_byte_detection)));
|
||||
coding->spec.undecided.inhibit_ied
|
||||
= (encode_inhibit_flag
|
||||
(AREF (attrs, coding_attr_undecided_inhibit_iso_escape_detection)));
|
||||
|
@ -6535,9 +6535,9 @@ detect_coding (struct coding_system *coding)
|
|||
{
|
||||
int c, i;
|
||||
struct coding_detection_info detect_info;
|
||||
bool nul_byte_found = 0, eight_bit_found = 0;
|
||||
bool null_byte_found = 0, eight_bit_found = 0;
|
||||
bool inhibit_nbd = inhibit_flag (coding->spec.undecided.inhibit_nbd,
|
||||
inhibit_nul_byte_detection);
|
||||
inhibit_null_byte_detection);
|
||||
bool inhibit_ied = inhibit_flag (coding->spec.undecided.inhibit_ied,
|
||||
inhibit_iso_escape_detection);
|
||||
bool prefer_utf_8 = coding->spec.undecided.prefer_utf_8;
|
||||
|
@ -6550,7 +6550,7 @@ detect_coding (struct coding_system *coding)
|
|||
if (c & 0x80)
|
||||
{
|
||||
eight_bit_found = 1;
|
||||
if (nul_byte_found)
|
||||
if (null_byte_found)
|
||||
break;
|
||||
}
|
||||
else if (c < 0x20)
|
||||
|
@ -6565,7 +6565,7 @@ detect_coding (struct coding_system *coding)
|
|||
if (! (detect_info.rejected & CATEGORY_MASK_ISO_7_ELSE))
|
||||
{
|
||||
/* We didn't find an 8-bit code. We may
|
||||
have found a NUL-byte, but it's very
|
||||
have found a null-byte, but it's very
|
||||
rare that a binary file conforms to
|
||||
ISO-2022. */
|
||||
src = src_end;
|
||||
|
@ -6577,7 +6577,7 @@ detect_coding (struct coding_system *coding)
|
|||
}
|
||||
else if (! c && !inhibit_nbd)
|
||||
{
|
||||
nul_byte_found = 1;
|
||||
null_byte_found = 1;
|
||||
if (eight_bit_found)
|
||||
break;
|
||||
}
|
||||
|
@ -6609,7 +6609,7 @@ detect_coding (struct coding_system *coding)
|
|||
coding->head_ascii++;
|
||||
}
|
||||
|
||||
if (nul_byte_found || eight_bit_found
|
||||
if (null_byte_found || eight_bit_found
|
||||
|| coding->head_ascii < coding->src_bytes
|
||||
|| detect_info.found)
|
||||
{
|
||||
|
@ -6627,7 +6627,7 @@ detect_coding (struct coding_system *coding)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (nul_byte_found)
|
||||
if (null_byte_found)
|
||||
{
|
||||
detect_info.checked |= ~CATEGORY_MASK_UTF_16;
|
||||
detect_info.rejected |= ~CATEGORY_MASK_UTF_16;
|
||||
|
@ -6700,7 +6700,7 @@ detect_coding (struct coding_system *coding)
|
|||
else
|
||||
found = CODING_ID_NAME (this->id);
|
||||
}
|
||||
else if (nul_byte_found)
|
||||
else if (null_byte_found)
|
||||
found = Qno_conversion;
|
||||
else if ((detect_info.rejected & CATEGORY_MASK_ANY)
|
||||
== CATEGORY_MASK_ANY)
|
||||
|
@ -8476,7 +8476,7 @@ from_unicode (Lisp_Object str)
|
|||
Lisp_Object
|
||||
from_unicode_buffer (const wchar_t *wstr)
|
||||
{
|
||||
/* We get one of the two final NUL bytes for free. */
|
||||
/* We get one of the two final null bytes for free. */
|
||||
ptrdiff_t len = 1 + sizeof (wchar_t) * wcslen (wstr);
|
||||
AUTO_STRING_WITH_LEN (str, (char *) wstr, len);
|
||||
return from_unicode (str);
|
||||
|
@ -8489,7 +8489,7 @@ to_unicode (Lisp_Object str, Lisp_Object *buf)
|
|||
/* We need to make another copy (in addition to the one made by
|
||||
code_convert_string_norecord) to ensure that the final string is
|
||||
_doubly_ zero terminated --- that is, that the string is
|
||||
terminated by two zero bytes and one utf-16le NUL character.
|
||||
terminated by two zero bytes and one utf-16le null character.
|
||||
Because strings are already terminated with a single zero byte,
|
||||
we just add one additional zero. */
|
||||
str = make_uninit_string (SBYTES (*buf) + 1);
|
||||
|
@ -8605,7 +8605,7 @@ detect_coding_system (const unsigned char *src,
|
|||
ptrdiff_t id;
|
||||
struct coding_detection_info detect_info;
|
||||
enum coding_category base_category;
|
||||
bool nul_byte_found = 0, eight_bit_found = 0;
|
||||
bool null_byte_found = 0, eight_bit_found = 0;
|
||||
|
||||
if (NILP (coding_system))
|
||||
coding_system = Qundecided;
|
||||
|
@ -8632,7 +8632,7 @@ detect_coding_system (const unsigned char *src,
|
|||
struct coding_system *this UNINIT;
|
||||
int c, i;
|
||||
bool inhibit_nbd = inhibit_flag (coding.spec.undecided.inhibit_nbd,
|
||||
inhibit_nul_byte_detection);
|
||||
inhibit_null_byte_detection);
|
||||
bool inhibit_ied = inhibit_flag (coding.spec.undecided.inhibit_ied,
|
||||
inhibit_iso_escape_detection);
|
||||
bool prefer_utf_8 = coding.spec.undecided.prefer_utf_8;
|
||||
|
@ -8644,7 +8644,7 @@ detect_coding_system (const unsigned char *src,
|
|||
if (c & 0x80)
|
||||
{
|
||||
eight_bit_found = 1;
|
||||
if (nul_byte_found)
|
||||
if (null_byte_found)
|
||||
break;
|
||||
}
|
||||
else if (c < 0x20)
|
||||
|
@ -8659,7 +8659,7 @@ detect_coding_system (const unsigned char *src,
|
|||
if (! (detect_info.rejected & CATEGORY_MASK_ISO_7_ELSE))
|
||||
{
|
||||
/* We didn't find an 8-bit code. We may
|
||||
have found a NUL-byte, but it's very
|
||||
have found a null-byte, but it's very
|
||||
rare that a binary file confirm to
|
||||
ISO-2022. */
|
||||
src = src_end;
|
||||
|
@ -8671,7 +8671,7 @@ detect_coding_system (const unsigned char *src,
|
|||
}
|
||||
else if (! c && !inhibit_nbd)
|
||||
{
|
||||
nul_byte_found = 1;
|
||||
null_byte_found = 1;
|
||||
if (eight_bit_found)
|
||||
break;
|
||||
}
|
||||
|
@ -8682,7 +8682,7 @@ detect_coding_system (const unsigned char *src,
|
|||
coding.head_ascii++;
|
||||
}
|
||||
|
||||
if (nul_byte_found || eight_bit_found
|
||||
if (null_byte_found || eight_bit_found
|
||||
|| coding.head_ascii < coding.src_bytes
|
||||
|| detect_info.found)
|
||||
{
|
||||
|
@ -8697,7 +8697,7 @@ detect_coding_system (const unsigned char *src,
|
|||
}
|
||||
else
|
||||
{
|
||||
if (nul_byte_found)
|
||||
if (null_byte_found)
|
||||
{
|
||||
detect_info.checked |= ~CATEGORY_MASK_UTF_16;
|
||||
detect_info.rejected |= ~CATEGORY_MASK_UTF_16;
|
||||
|
@ -8744,7 +8744,7 @@ detect_coding_system (const unsigned char *src,
|
|||
}
|
||||
|
||||
if ((detect_info.rejected & CATEGORY_MASK_ANY) == CATEGORY_MASK_ANY
|
||||
|| nul_byte_found)
|
||||
|| null_byte_found)
|
||||
{
|
||||
detect_info.found = CATEGORY_MASK_RAW_TEXT;
|
||||
id = CODING_SYSTEM_ID (Qno_conversion);
|
||||
|
@ -8846,7 +8846,7 @@ detect_coding_system (const unsigned char *src,
|
|||
{
|
||||
if (detect_info.found & ~CATEGORY_MASK_UTF_16)
|
||||
{
|
||||
if (nul_byte_found)
|
||||
if (null_byte_found)
|
||||
normal_eol = EOL_SEEN_LF;
|
||||
else
|
||||
normal_eol = detect_eol (coding.source, src_bytes,
|
||||
|
@ -11320,8 +11320,8 @@ usage: (define-coding-system-internal ...) */)
|
|||
{
|
||||
if (nargs < coding_arg_undecided_max)
|
||||
goto short_args;
|
||||
ASET (attrs, coding_attr_undecided_inhibit_nul_byte_detection,
|
||||
args[coding_arg_undecided_inhibit_nul_byte_detection]);
|
||||
ASET (attrs, coding_attr_undecided_inhibit_null_byte_detection,
|
||||
args[coding_arg_undecided_inhibit_null_byte_detection]);
|
||||
ASET (attrs, coding_attr_undecided_inhibit_iso_escape_detection,
|
||||
args[coding_arg_undecided_inhibit_iso_escape_detection]);
|
||||
ASET (attrs, coding_attr_undecided_prefer_utf_8,
|
||||
|
@ -12086,18 +12086,18 @@ to explicitly specify some coding system that doesn't use ISO-2022
|
|||
escape sequence (e.g., `latin-1') on reading by \\[universal-coding-system-argument]. */);
|
||||
inhibit_iso_escape_detection = 0;
|
||||
|
||||
DEFVAR_BOOL ("inhibit-nul-byte-detection",
|
||||
inhibit_nul_byte_detection,
|
||||
doc: /* If non-nil, Emacs ignores NUL bytes on code detection.
|
||||
DEFVAR_BOOL ("inhibit-null-byte-detection",
|
||||
inhibit_null_byte_detection,
|
||||
doc: /* If non-nil, Emacs ignores null bytes on code detection.
|
||||
By default, Emacs treats it as binary data, and does not attempt to
|
||||
decode it. The effect is as if you specified `no-conversion' for
|
||||
reading that text.
|
||||
|
||||
Set this to non-nil when a regular text happens to include NUL bytes.
|
||||
Examples are Index nodes of Info files and NUL-byte delimited output
|
||||
from GNU Find and GNU Grep. Emacs will then ignore the NUL bytes and
|
||||
Set this to non-nil when a regular text happens to include null bytes.
|
||||
Examples are Index nodes of Info files and null-byte delimited output
|
||||
from GNU Find and GNU Grep. Emacs will then ignore the null bytes and
|
||||
decode text as usual. */);
|
||||
inhibit_nul_byte_detection = 0;
|
||||
inhibit_null_byte_detection = 0;
|
||||
|
||||
DEFVAR_BOOL ("disable-ascii-optimization", disable_ascii_optimization,
|
||||
doc: /* If non-nil, Emacs does not optimize code decoder for ASCII files.
|
||||
|
@ -12156,7 +12156,7 @@ internal character representation. */);
|
|||
"automatic conversion on decoding.");
|
||||
plist[15] = args[coding_arg_eol_type] = Qnil;
|
||||
args[coding_arg_plist] = CALLMANY (Flist, plist);
|
||||
args[coding_arg_undecided_inhibit_nul_byte_detection] = make_fixnum (0);
|
||||
args[coding_arg_undecided_inhibit_null_byte_detection] = make_fixnum (0);
|
||||
args[coding_arg_undecided_inhibit_iso_escape_detection] = make_fixnum (0);
|
||||
Fdefine_coding_system_internal (coding_arg_undecided_max, args);
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ enum define_coding_ccl_arg_index
|
|||
|
||||
enum define_coding_undecided_arg_index
|
||||
{
|
||||
coding_arg_undecided_inhibit_nul_byte_detection = coding_arg_max,
|
||||
coding_arg_undecided_inhibit_null_byte_detection = coding_arg_max,
|
||||
coding_arg_undecided_inhibit_iso_escape_detection,
|
||||
coding_arg_undecided_prefer_utf_8,
|
||||
coding_arg_undecided_max
|
||||
|
@ -139,7 +139,7 @@ enum coding_attr_index
|
|||
|
||||
coding_attr_emacs_mule_full,
|
||||
|
||||
coding_attr_undecided_inhibit_nul_byte_detection,
|
||||
coding_attr_undecided_inhibit_null_byte_detection,
|
||||
coding_attr_undecided_inhibit_iso_escape_detection,
|
||||
coding_attr_undecided_prefer_utf_8,
|
||||
|
||||
|
@ -353,7 +353,7 @@ struct emacs_mule_spec
|
|||
|
||||
struct undecided_spec
|
||||
{
|
||||
/* Inhibit NUL byte detection. 1 means always inhibit,
|
||||
/* Inhibit null byte detection. 1 means always inhibit,
|
||||
-1 means do not inhibit, 0 means rely on user variable. */
|
||||
int inhibit_nbd;
|
||||
|
||||
|
|
|
@ -929,7 +929,7 @@ file_attributes (int fd, char const *name,
|
|||
struct stat s;
|
||||
|
||||
/* An array to hold the mode string generated by filemodestring,
|
||||
including its terminating space and NUL byte. */
|
||||
including its terminating space and null byte. */
|
||||
char modes[sizeof "-rwxr-xr-x "];
|
||||
|
||||
char *uname = NULL, *gname = NULL;
|
||||
|
|
|
@ -1996,7 +1996,7 @@ struct bidi_string_data {
|
|||
Lisp_Object lstring; /* Lisp string to reorder, or nil */
|
||||
const unsigned char *s; /* string data, or NULL if reordering buffer */
|
||||
ptrdiff_t schars; /* the number of characters in the string,
|
||||
excluding the terminating NUL */
|
||||
excluding the terminating null */
|
||||
ptrdiff_t bufpos; /* buffer position of lstring, or 0 if N/A */
|
||||
bool_bf from_disp_str : 1; /* True means the string comes from a
|
||||
display property */
|
||||
|
|
|
@ -233,7 +233,7 @@ get_doc_string (Lisp_Object filepos, bool unibyte, bool definition)
|
|||
}
|
||||
|
||||
/* Scan the text and perform quoting with ^A (char code 1).
|
||||
^A^A becomes ^A, ^A0 becomes a NUL char, and ^A_ becomes a ^_. */
|
||||
^A^A becomes ^A, ^A0 becomes a null char, and ^A_ becomes a ^_. */
|
||||
from = get_doc_string_buffer + offset;
|
||||
to = get_doc_string_buffer + offset;
|
||||
while (from != p)
|
||||
|
|
|
@ -35,7 +35,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
|
|||
sequence.
|
||||
|
||||
. It accepts a pointer to the end of the format string, so the format string
|
||||
could include embedded NUL characters.
|
||||
could include embedded null characters.
|
||||
|
||||
. It signals an error if the length of the formatted string is about to
|
||||
overflow ptrdiff_t or size_t, to avoid producing strings longer than what
|
||||
|
@ -123,7 +123,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
|
|||
to fit and return BUFSIZE - 1; if this truncates a multibyte
|
||||
sequence, store '\0' into the sequence's first byte.
|
||||
Returns the number of bytes stored into BUFFER, excluding
|
||||
the terminating NUL byte. Output is always NUL-terminated.
|
||||
the terminating null byte. Output is always null-terminated.
|
||||
String arguments are passed as C strings.
|
||||
Integers are passed as C integers. */
|
||||
|
||||
|
|
|
@ -3069,7 +3069,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message)
|
|||
: FLT_RADIX == 16 ? 4
|
||||
: -1)),
|
||||
|
||||
/* Maximum number of bytes (including terminating NUL) generated
|
||||
/* Maximum number of bytes (including terminating null) generated
|
||||
by any format, if precision is no more than USEFUL_PRECISION_MAX.
|
||||
On all practical hosts, %Lf is the worst case. */
|
||||
SPRINTF_BUFSIZE = (sizeof "-." + (LDBL_MAX_10_EXP + 1)
|
||||
|
|
|
@ -2735,7 +2735,7 @@ decode_env_path (const char *evarname, const char *defalt, bool empty)
|
|||
}
|
||||
}
|
||||
else if (cnv_result != 0 && d > path_utf8)
|
||||
d[-1] = '\0'; /* remove last semi-colon and NUL-terminate PATH */
|
||||
d[-1] = '\0'; /* remove last semi-colon and null-terminate PATH */
|
||||
} while (q);
|
||||
path_copy = path_utf8;
|
||||
#else /* MSDOS */
|
||||
|
|
|
@ -1710,7 +1710,7 @@ See also the function `substitute-in-file-name'.")
|
|||
#endif
|
||||
|
||||
/* Put into BUF the concatenation of DIR and FILE, with an intervening
|
||||
directory separator if needed. Return a pointer to the NUL byte
|
||||
directory separator if needed. Return a pointer to the null byte
|
||||
at the end of the concatenated string. */
|
||||
char *
|
||||
splice_dir_file (char *buf, char const *dir, char const *file)
|
||||
|
|
|
@ -296,7 +296,7 @@ typedef struct
|
|||
|
||||
/* Write the name of the lock file for FNAME into LOCKNAME. Length
|
||||
will be that of FNAME plus two more for the leading ".#", plus one
|
||||
for the NUL. */
|
||||
for the null. */
|
||||
#define MAKE_LOCK_NAME(lockname, fname) \
|
||||
(lockname = SAFE_ALLOCA (SBYTES (fname) + 2 + 1), \
|
||||
fill_in_lock_file_name (lockname, fname))
|
||||
|
|
|
@ -406,7 +406,7 @@ string_version_cmp (Lisp_Object string1, Lisp_Object string2)
|
|||
|
||||
while ((cmp = filevercmp (p1, p2)) == 0)
|
||||
{
|
||||
/* If the strings are identical through their first NUL bytes,
|
||||
/* If the strings are identical through their first null bytes,
|
||||
skip past identical prefixes and try again. */
|
||||
ptrdiff_t size = strlen (p1) + 1;
|
||||
eassert (size == strlen (p2) + 1);
|
||||
|
|
|
@ -1011,7 +1011,7 @@ font_expand_wildcards (Lisp_Object *field, int n)
|
|||
}
|
||||
|
||||
|
||||
/* Parse NAME (NUL terminated) as XLFD and store information in FONT
|
||||
/* Parse NAME (null terminated) as XLFD and store information in FONT
|
||||
(font-spec or font-entity). Size property of FONT is set as
|
||||
follows:
|
||||
specified XLFD fields FONT property
|
||||
|
@ -1355,7 +1355,7 @@ font_unparse_xlfd (Lisp_Object font, int pixel_size, char *name, int nbytes)
|
|||
return len < nbytes ? len : -1;
|
||||
}
|
||||
|
||||
/* Parse NAME (NUL terminated) and store information in FONT
|
||||
/* Parse NAME (null terminated) and store information in FONT
|
||||
(font-spec or font-entity). NAME is supplied in either the
|
||||
Fontconfig or GTK font name format. If NAME is successfully
|
||||
parsed, return 0. Otherwise return -1.
|
||||
|
@ -1727,7 +1727,7 @@ font_unparse_fcname (Lisp_Object font, int pixel_size, char *name, int nbytes)
|
|||
|
||||
#endif
|
||||
|
||||
/* Parse NAME (NUL terminated) and store information in FONT
|
||||
/* Parse NAME (null terminated) and store information in FONT
|
||||
(font-spec or font-entity). If NAME is successfully parsed, return
|
||||
0. Otherwise return -1. */
|
||||
|
||||
|
|
|
@ -714,7 +714,7 @@ insert_char (int c)
|
|||
insert ((char *) str, len);
|
||||
}
|
||||
|
||||
/* Insert the NUL-terminated string S before point. */
|
||||
/* Insert the null-terminated string S before point. */
|
||||
|
||||
void
|
||||
insert_string (const char *s)
|
||||
|
|
18
src/json.c
18
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);
|
||||
|
|
|
@ -6234,7 +6234,7 @@ parse_modifiers_uncached (Lisp_Object symbol, ptrdiff_t *modifier_end)
|
|||
static Lisp_Object
|
||||
apply_modifiers_uncached (int modifiers, char *base, int base_len, int base_len_byte)
|
||||
{
|
||||
/* Since BASE could contain NULs, we can't use intern here; we have
|
||||
/* Since BASE could contain nulls, we can't use intern here; we have
|
||||
to use Fintern, which expects a genuine Lisp_String, and keeps a
|
||||
reference to it. */
|
||||
char new_mods[sizeof "A-C-H-M-S-s-up-down-drag-double-triple-"];
|
||||
|
|
14
src/lisp.h
14
src/lisp.h
|
@ -1516,11 +1516,11 @@ STRING_MULTIBYTE (Lisp_Object str)
|
|||
}
|
||||
|
||||
/* An upper bound on the number of bytes in a Lisp string, not
|
||||
counting the terminating NUL. This a tight enough bound to
|
||||
counting the terminating null. This a tight enough bound to
|
||||
prevent integer overflow errors that would otherwise occur during
|
||||
string size calculations. A string cannot contain more bytes than
|
||||
a fixnum can represent, nor can it be so long that C pointer
|
||||
arithmetic stops working on the string plus its terminating NUL.
|
||||
arithmetic stops working on the string plus its terminating null.
|
||||
Although the actual size limit (see STRING_BYTES_MAX in alloc.c)
|
||||
may be a bit smaller than STRING_BYTES_BOUND, calculating it here
|
||||
would expose alloc.c internal details that we'd rather keep
|
||||
|
@ -2988,7 +2988,7 @@ CHECK_INTEGER (Lisp_Object x)
|
|||
|
||||
/* Define a built-in function for calling from Lisp.
|
||||
`lname' should be the name to give the function in Lisp,
|
||||
as a NUL-terminated C string.
|
||||
as a null-terminated C string.
|
||||
`fnname' should be the name of the function in C.
|
||||
By convention, it starts with F.
|
||||
`sname' should be the name for the C constant structure
|
||||
|
@ -4739,7 +4739,7 @@ extern char *xlispstrdup (Lisp_Object) ATTRIBUTE_MALLOC;
|
|||
extern void dupstring (char **, char const *);
|
||||
|
||||
/* Make DEST a copy of STRING's data. Return a pointer to DEST's terminating
|
||||
NUL byte. This is like stpcpy, except the source is a Lisp string. */
|
||||
null byte. This is like stpcpy, except the source is a Lisp string. */
|
||||
|
||||
INLINE char *
|
||||
lispstpcpy (char *dest, Lisp_Object string)
|
||||
|
@ -4957,7 +4957,7 @@ enum
|
|||
: list4 (a, b, c, d))
|
||||
|
||||
/* Declare NAME as an auto Lisp string if possible, a GC-based one if not.
|
||||
Take its unibyte value from the NUL-terminated string STR,
|
||||
Take its unibyte value from the null-terminated string STR,
|
||||
an expression that should not have side effects.
|
||||
STR's value is not necessarily copied. The resulting Lisp string
|
||||
should not be modified or given text properties or made visible to
|
||||
|
@ -4967,8 +4967,8 @@ enum
|
|||
AUTO_STRING_WITH_LEN (name, str, strlen (str))
|
||||
|
||||
/* Declare NAME as an auto Lisp string if possible, a GC-based one if not.
|
||||
Take its unibyte value from the NUL-terminated string STR with length LEN.
|
||||
STR may have side effects and may contain NUL bytes.
|
||||
Take its unibyte value from the null-terminated string STR with length LEN.
|
||||
STR may have side effects and may contain null bytes.
|
||||
STR's value is not necessarily copied. The resulting Lisp string
|
||||
should not be modified or given text properties or made visible to
|
||||
user code. */
|
||||
|
|
|
@ -80,13 +80,13 @@
|
|||
EMACS_ATTRIBUTE_NONNULL(1);
|
||||
|
||||
/* Copy the content of the Lisp string VALUE to BUFFER as an utf8
|
||||
NUL-terminated string.
|
||||
null-terminated string.
|
||||
|
||||
SIZE must point to the total size of the buffer. If BUFFER is
|
||||
NULL or if SIZE is not big enough, write the required buffer size
|
||||
to SIZE and return true.
|
||||
|
||||
Note that SIZE must include the last NUL byte (e.g. "abc" needs
|
||||
Note that SIZE must include the last null byte (e.g. "abc" needs
|
||||
a buffer of size 4).
|
||||
|
||||
Return true if the string was successfully copied. */
|
||||
|
|
|
@ -267,12 +267,12 @@ get_current_dir_name_or_unreachable (void)
|
|||
|
||||
char *pwd;
|
||||
|
||||
/* The maximum size of a directory name, including the terminating NUL.
|
||||
/* The maximum size of a directory name, including the terminating null.
|
||||
Leave room so that the caller can append a trailing slash. */
|
||||
ptrdiff_t dirsize_max = min (PTRDIFF_MAX, SIZE_MAX) - 1;
|
||||
|
||||
/* The maximum size of a buffer for a file name, including the
|
||||
terminating NUL. This is bounded by PATH_MAX, if available. */
|
||||
terminating null. This is bounded by PATH_MAX, if available. */
|
||||
ptrdiff_t bufsize_max = dirsize_max;
|
||||
#ifdef PATH_MAX
|
||||
bufsize_max = min (bufsize_max, PATH_MAX);
|
||||
|
@ -3331,7 +3331,7 @@ system_process_attributes (Lisp_Object pid)
|
|||
|
||||
if (nread)
|
||||
{
|
||||
/* We don't want trailing NUL characters. */
|
||||
/* We don't want trailing null characters. */
|
||||
for (p = cmdline + nread; cmdline < p && !p[-1]; p--)
|
||||
continue;
|
||||
|
||||
|
|
|
@ -162,7 +162,7 @@ tgetst1 (char *ptr, char **area)
|
|||
else
|
||||
ret = *area;
|
||||
|
||||
/* Copy the string value, stopping at NUL or colon.
|
||||
/* Copy the string value, stopping at null or colon.
|
||||
Also process ^ and \ abbreviations. */
|
||||
p = ptr;
|
||||
r = ret;
|
||||
|
@ -424,7 +424,7 @@ tgetent (char *bp, const char *name)
|
|||
return -1;
|
||||
|
||||
buf.size = BUFSIZE;
|
||||
/* Add 1 to size to ensure room for terminating NUL. */
|
||||
/* Add 1 to size to ensure room for terminating null. */
|
||||
buf.beg = xmalloc (buf.size + 1);
|
||||
term = indirect ? indirect : (char *)name;
|
||||
|
||||
|
@ -480,7 +480,7 @@ tgetent (char *bp, const char *name)
|
|||
*bp1 = '\0';
|
||||
|
||||
/* Does this entry refer to another terminal type's entry?
|
||||
If something is found, copy it into heap and NUL-terminate it. */
|
||||
If something is found, copy it into heap and null-terminate it. */
|
||||
tc_search_point = find_capability (tc_search_point, "tc");
|
||||
term = tgetst1 (tc_search_point, 0);
|
||||
}
|
||||
|
@ -618,7 +618,7 @@ gobble_line (int fd, register struct termcap_buffer *bufp, char *append_end)
|
|||
{
|
||||
ptrdiff_t ptr_offset = bufp->ptr - buf;
|
||||
ptrdiff_t append_end_offset = append_end - buf;
|
||||
/* Add 1 to size to ensure room for terminating NUL. */
|
||||
/* Add 1 to size to ensure room for terminating null. */
|
||||
ptrdiff_t size = bufp->size + 1;
|
||||
bufp->beg = buf = xpalloc (buf, &size, 1, -1, 1);
|
||||
bufp->size = size - 1;
|
||||
|
|
|
@ -1311,7 +1311,7 @@ or (if you need time as a string) `format-time-string'. */)
|
|||
determine how many bytes would be written, use NULL for S and
|
||||
((size_t) -1) for MAXSIZE.
|
||||
|
||||
This function behaves like nstrftime, except it allows NUL
|
||||
This function behaves like nstrftime, except it allows null
|
||||
bytes in FORMAT. */
|
||||
static size_t
|
||||
emacs_nmemftime (char *s, size_t maxsize, const char *format,
|
||||
|
@ -1320,8 +1320,8 @@ emacs_nmemftime (char *s, size_t maxsize, const char *format,
|
|||
int saved_errno = errno;
|
||||
size_t total = 0;
|
||||
|
||||
/* Loop through all the NUL-terminated strings in the format
|
||||
argument. Normally there's just one NUL-terminated string, but
|
||||
/* Loop through all the null-terminated strings in the format
|
||||
argument. Normally there's just one null-terminated string, but
|
||||
there can be arbitrarily many, concatenated together, if the
|
||||
format contains '\0' bytes. nstrftime stops at the first
|
||||
'\0' byte so we must invoke it separately for each such string. */
|
||||
|
|
|
@ -447,7 +447,7 @@ unexec_regions_recorder (task_t task, void *rr, unsigned type,
|
|||
|
||||
while (num && num_unexec_regions < MAX_UNEXEC_REGIONS)
|
||||
{
|
||||
/* Subtract the size of trailing NUL bytes from filesize. It
|
||||
/* Subtract the size of trailing null bytes from filesize. It
|
||||
can be smaller than vmsize in segment commands. In such a
|
||||
case, trailing bytes are initialized with zeros. */
|
||||
for (p = ranges->address + ranges->size; p > ranges->address; p--)
|
||||
|
|
|
@ -220,7 +220,7 @@ set_clipboard_data (unsigned Format, void *Data, unsigned Size, int Raw)
|
|||
/* need to know final size after '\r' chars are inserted (the
|
||||
standard CF_OEMTEXT clipboard format uses CRLF line endings,
|
||||
while Emacs uses just LF internally). */
|
||||
truelen = Size + 1; /* +1 for the terminating NUL */
|
||||
truelen = Size + 1; /* +1 for the terminating null */
|
||||
|
||||
if (!Raw)
|
||||
{
|
||||
|
@ -243,7 +243,7 @@ set_clipboard_data (unsigned Format, void *Data, unsigned Size, int Raw)
|
|||
{
|
||||
dosmemput (Data, Size, xbuf_addr);
|
||||
|
||||
/* Terminate with a NUL, otherwise Windows does strange things
|
||||
/* Terminate with a null, otherwise Windows does strange things
|
||||
when the text size is an integral multiple of 32 bytes. */
|
||||
_farpokeb (_dos_ds, xbuf_addr + Size, '\0');
|
||||
}
|
||||
|
@ -255,7 +255,7 @@ set_clipboard_data (unsigned Format, void *Data, unsigned Size, int Raw)
|
|||
while (Size--)
|
||||
{
|
||||
/* Don't allow them to put binary data into the clipboard, since
|
||||
it will cause yanked data to be truncated at the first NUL. */
|
||||
it will cause yanked data to be truncated at the first null. */
|
||||
if (*dp == '\0')
|
||||
return 2;
|
||||
if (*dp == '\n')
|
||||
|
@ -263,7 +263,7 @@ set_clipboard_data (unsigned Format, void *Data, unsigned Size, int Raw)
|
|||
_farnspokeb (buf_offset++, *dp++);
|
||||
}
|
||||
|
||||
/* Terminate with a NUL, otherwise Windows does strange things
|
||||
/* Terminate with a null, otherwise Windows does strange things
|
||||
when the text size is an integral multiple of 32 bytes. */
|
||||
_farnspokeb (buf_offset, '\0');
|
||||
}
|
||||
|
@ -354,13 +354,13 @@ get_clipboard_data (unsigned Format, void *Data, unsigned Size, int Raw)
|
|||
__dpmi_int (0x2f, ®s);
|
||||
if (regs.x.ax != 0)
|
||||
{
|
||||
unsigned char nul_char = '\0';
|
||||
unsigned char null_char = '\0';
|
||||
unsigned long xbuf_beg = xbuf_addr;
|
||||
|
||||
/* If last_clipboard_text is NULL, we don't want to slow down
|
||||
the next loop by an additional test. */
|
||||
register unsigned char *lcdp =
|
||||
last_clipboard_text == NULL ? &nul_char : last_clipboard_text;
|
||||
last_clipboard_text == NULL ? &null_char : last_clipboard_text;
|
||||
|
||||
/* Copy data from low memory, remove CR
|
||||
characters before LF if needed. */
|
||||
|
@ -383,7 +383,7 @@ get_clipboard_data (unsigned Format, void *Data, unsigned Size, int Raw)
|
|||
/* Windows reportedly rounds up the size of clipboard data
|
||||
(passed in SIZE) to a multiple of 32, and removes trailing
|
||||
spaces from each line without updating SIZE. We therefore
|
||||
bail out when we see the first NUL character. */
|
||||
bail out when we see the first null character. */
|
||||
else if (c == '\0')
|
||||
break;
|
||||
}
|
||||
|
@ -392,7 +392,7 @@ get_clipboard_data (unsigned Format, void *Data, unsigned Size, int Raw)
|
|||
last time set_clipboard_data was called, pretend there's no
|
||||
data in the clipboard. This is so we don't pass our own text
|
||||
from the clipboard (which might be troublesome if the killed
|
||||
text includes NUL characters). */
|
||||
text includes null characters). */
|
||||
if (last_clipboard_text &&
|
||||
xbuf_addr - xbuf_beg == (long)(lcdp - last_clipboard_text))
|
||||
dp = (unsigned char *)Data + 1;
|
||||
|
|
12
src/w32.c
12
src/w32.c
|
@ -6144,7 +6144,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
|
||||
NUL-terminate the target name, even if it fits. Return the number
|
||||
null-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. */
|
||||
|
@ -6248,10 +6248,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 NUL character. */
|
||||
terminating null character. */
|
||||
lwname = alloca ((lwname_len + 1) * sizeof(WCHAR));
|
||||
memcpy (lwname, lwname_src, lwname_len);
|
||||
lwname[lwname_len/sizeof(WCHAR)] = 0; /* NUL-terminate */
|
||||
lwname[lwname_len/sizeof(WCHAR)] = 0; /* null-terminate */
|
||||
filename_from_utf16 (lwname, resolved);
|
||||
dostounix_filename (resolved);
|
||||
lname_size = strlen (resolved) + 1;
|
||||
|
@ -9884,7 +9884,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 NUL bytes. */
|
||||
/* wchar_t strings need to be terminated by 2 null 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));
|
||||
|
@ -9976,7 +9976,7 @@ w32_read_registry (HKEY rootkey, Lisp_Object lkey, Lisp_Object lname)
|
|||
case REG_SZ:
|
||||
if (use_unicode)
|
||||
{
|
||||
/* pvalue ends with 2 NUL bytes, but we need only one,
|
||||
/* pvalue ends with 2 null bytes, but we need only one,
|
||||
and AUTO_STRING_WITH_LEN will add it. */
|
||||
if (pvalue[vsize - 1] == '\0')
|
||||
vsize -= 2;
|
||||
|
@ -9985,7 +9985,7 @@ w32_read_registry (HKEY rootkey, Lisp_Object lkey, Lisp_Object lname)
|
|||
}
|
||||
else
|
||||
{
|
||||
/* Don't waste a byte on the terminating NUL character,
|
||||
/* Don't waste a byte on the terminating null character,
|
||||
since make_unibyte_string will add one anyway. */
|
||||
if (pvalue[vsize - 1] == '\0')
|
||||
vsize--;
|
||||
|
|
|
@ -7960,7 +7960,7 @@ DEFUN ("system-move-file-to-trash", Fsystem_move_file_to_trash,
|
|||
{
|
||||
SHFILEOPSTRUCTW file_op_w;
|
||||
/* We need one more element beyond MAX_PATH because this is
|
||||
a list of file names, with the last element double-NUL
|
||||
a list of file names, with the last element double-null
|
||||
terminated. */
|
||||
wchar_t tmp_path_w[MAX_PATH + 1];
|
||||
|
||||
|
@ -9732,7 +9732,7 @@ get_dll_version (const char *dll_name)
|
|||
/* Return the number of bytes in UTF-8 encoded string STR that
|
||||
corresponds to at most LIM characters. If STR ends before LIM
|
||||
characters, return the number of bytes in STR including the
|
||||
terminating NUL byte. */
|
||||
terminating null byte. */
|
||||
static int
|
||||
utf8_mbslen_lim (const char *str, int lim)
|
||||
{
|
||||
|
|
|
@ -2007,9 +2007,9 @@ sys_spawnve (int mode, char *cmdname, char **argv, char **envp)
|
|||
}
|
||||
|
||||
/* we have to do some conjuring here to put argv and envp into the
|
||||
form CreateProcess wants... argv needs to be a space separated/NUL
|
||||
terminated list of parameters, and envp is a NUL
|
||||
separated/double-NUL terminated list of parameters.
|
||||
form CreateProcess wants... argv needs to be a space separated/null
|
||||
terminated list of parameters, and envp is a null
|
||||
separated/double-null terminated list of parameters.
|
||||
|
||||
Additionally, zero-length args and args containing whitespace or
|
||||
quote chars need to be wrapped in double quotes - for this to work,
|
||||
|
@ -3398,10 +3398,10 @@ If LCID (a 16-bit number) is not a valid locale, the result is nil. */)
|
|||
got_full = GetLocaleInfo (XFIXNUM (lcid),
|
||||
XFIXNUM (longform),
|
||||
full_name, sizeof (full_name));
|
||||
/* GetLocaleInfo's return value includes the terminating NUL
|
||||
/* GetLocaleInfo's return value includes the terminating null
|
||||
character, when the returned information is a string, whereas
|
||||
make_unibyte_string needs the string length without the
|
||||
terminating NUL. */
|
||||
terminating null. */
|
||||
if (got_full)
|
||||
return make_unibyte_string (full_name, got_full - 1);
|
||||
}
|
||||
|
|
|
@ -803,7 +803,7 @@ DEFUN ("w32-get-clipboard-data", Fw32_get_clipboard_data,
|
|||
(void) ignored;
|
||||
|
||||
/* Don't pass our own text from the clipboard (which might be
|
||||
troublesome if the killed text includes NUL characters). */
|
||||
troublesome if the killed text includes null characters). */
|
||||
if (!NILP (current_text))
|
||||
return ret;
|
||||
|
||||
|
|
10
src/xdisp.c
10
src/xdisp.c
|
@ -11043,7 +11043,7 @@ message_log_check_duplicate (ptrdiff_t prev_bol_byte, ptrdiff_t this_bol_byte)
|
|||
|
||||
|
||||
/* Display an echo area message M with a specified length of NBYTES
|
||||
bytes. The string may include NUL characters. If M is not a
|
||||
bytes. The string may include null characters. If M is not a
|
||||
string, clear out any existing message, and let the mini-buffer
|
||||
text show through.
|
||||
|
||||
|
@ -11146,7 +11146,7 @@ message3_nolog (Lisp_Object m)
|
|||
}
|
||||
|
||||
|
||||
/* Display a NUL-terminated echo area message M. If M is 0, clear
|
||||
/* Display a null-terminated echo area message M. If M is 0, clear
|
||||
out any existing message, and let the mini-buffer text show through.
|
||||
|
||||
The buffer M must continue to exist until after the echo area gets
|
||||
|
@ -26153,7 +26153,7 @@ are the selected window and the WINDOW's buffer). */)
|
|||
return unbind_to (count, str);
|
||||
}
|
||||
|
||||
/* Write a NUL-terminated, right justified decimal representation of
|
||||
/* Write a null-terminated, right justified decimal representation of
|
||||
the positive integer D to BUF using a minimal field width WIDTH. */
|
||||
|
||||
static void
|
||||
|
@ -26183,7 +26183,7 @@ pint2str (register char *buf, register int width, register ptrdiff_t d)
|
|||
}
|
||||
}
|
||||
|
||||
/* Write a NUL-terminated, right justified decimal and "human
|
||||
/* Write a null-terminated, right justified decimal and "human
|
||||
readable" representation of the nonnegative integer D to BUF using
|
||||
a minimal field width WIDTH. D should be smaller than 999.5e24. */
|
||||
|
||||
|
@ -26406,7 +26406,7 @@ decode_mode_spec (struct window *w, register int c, int field_width,
|
|||
produce strings from numerical values, so limit preposterously
|
||||
large values of FIELD_WIDTH to avoid overrunning the buffer's
|
||||
end. The size of the buffer is enough for FRAME_MESSAGE_BUF_SIZE
|
||||
bytes plus the terminating NUL. */
|
||||
bytes plus the terminating null. */
|
||||
int width = min (field_width, FRAME_MESSAGE_BUF_SIZE (f));
|
||||
struct buffer *b = current_buffer;
|
||||
|
||||
|
|
|
@ -133,7 +133,7 @@ compare_font_names (const void *name1, const void *name2)
|
|||
|
||||
/* Decode XLFD as iso-8859-1 into OUTPUT, and return the byte length
|
||||
of the decoding result. LEN is the byte length of XLFD, or -1 if
|
||||
XLFD is NUL terminated. The caller must assure that OUTPUT is at
|
||||
XLFD is NULL terminated. The caller must assure that OUTPUT is at
|
||||
least twice (plus 1) as large as XLFD. */
|
||||
|
||||
static ptrdiff_t
|
||||
|
|
Loading…
Add table
Reference in a new issue