* src/fileio.c (Fdirectory_append): Fix check for whether we need
to convert to multibyte.
(Fdirectory_append):
if (STRING_MULTIBYTE (arg) || string_ascii_p (arg))
elements[i] = arg;
else
- elements[i] = make_multibyte_string (SSDATA (arg), SCHARS (arg),
- SCHARS (arg));
+ elements[i] = Fstring_to_multibyte (arg);
arg = elements[i];
/* We have to recompute the number of bytes. */
if (i == nargs - 1
(should (equal (directory-append "fóo" "bar") "fóo/bar"))
(should (equal (directory-append "foo" "bár") "foo/bár"))
(should (equal (directory-append "fóo" "bár") "fóo/bár"))
+ (let ((string (make-string 5 ?a)))
+ (should (not (multibyte-string-p string)))
+ (aset string 2 255)
+ (should (not (multibyte-string-p string)))
+ (should (equal (directory-append "fóo" string) "fóo/aa\377aa")))
(should-error (directory-append "foo" ""))
(should-error (directory-append "" "bar"))
(should-error (directory-append "" "")))