# HG changeset patch # User Richard M. Stallman # Date 912204938 0 # Node ID f11f551fee99307048b5c26a88c53f77008a717b # Parent afe440aabd550bdd81dea8984951f52808bd4dfc (Fstring_as_unibyte, Fstring_as_multibyte): Clear text properties in the new string. diff -r afe440aabd55 -r f11f551fee99 src/fns.c --- a/src/fns.c Thu Nov 26 08:37:32 1998 +0000 +++ b/src/fns.c Fri Nov 27 22:15:38 1998 +0000 @@ -1002,7 +1002,9 @@ DEFUN ("string-as-unibyte", Fstring_as_unibyte, Sstring_as_unibyte, 1, 1, 0, "Return a unibyte string with the same individual bytes as STRING.\n\ -If STRING is unibyte, the result is STRING itself.") +If STRING is unibyte, the result is STRING itself.\n\ +If STRING is multibyte, the result is STRING itself.\n\ +Otherwise it is a newly created string, with no text properties.") (string) Lisp_Object string; { @@ -1012,6 +1014,7 @@ { string = Fcopy_sequence (string); XSTRING (string)->size = STRING_BYTES (XSTRING (string)); + XSTRING (string)->intervals = NULL_INTERVAL; SET_STRING_BYTES (XSTRING (string), -1); } return string; @@ -1020,7 +1023,8 @@ DEFUN ("string-as-multibyte", Fstring_as_multibyte, Sstring_as_multibyte, 1, 1, 0, "Return a multibyte string with the same individual bytes as STRING.\n\ -If STRING is multibyte, the result is STRING itself.") +If STRING is multibyte, the result is STRING itself.\n\ +Otherwise it is a newly created string, with no text properties.") (string) Lisp_Object string; { @@ -1034,6 +1038,7 @@ string = Fcopy_sequence (string); XSTRING (string)->size = newlen; XSTRING (string)->size_byte = nbytes; + XSTRING (string)->intervals = NULL_INTERVAL; } return string; }