Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
dec58e65
Commit
dec58e65
authored
Aug 10, 1997
by
Kenichi Handa
Browse files
(concat): Pay attention to multibyte characters when
TARGET_TYPE is Lisp_String.
parent
df8bf431
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
8 deletions
+18
-8
src/fns.c
src/fns.c
+18
-8
No files found.
src/fns.c
View file @
dec58e65
...
...
@@ -410,20 +410,30 @@ concat (nargs, args, target_type, last_special)
{
this
=
args
[
argnum
];
len
=
Flength
(
this
);
if
(
VECTORP
(
this
)
&&
target_type
==
Lisp_String
)
if
((
VECTORP
(
this
)
||
CONSP
(
this
))
&&
target_type
==
Lisp_String
)
{
/* We must pay attention to a multibyte character which
takes more than one byte in string. */
int
i
;
Lisp_Object
ch
;
for
(
i
=
0
;
i
<
XFASTINT
(
len
);
i
++
)
{
ch
=
XVECTOR
(
this
)
->
contents
[
i
];
if
(
!
INTEGERP
(
ch
))
wrong_type_argument
(
Qintegerp
,
ch
);
leni
+=
Fchar_bytes
(
ch
);
}
if
(
VECTORP
(
this
))
for
(
i
=
0
;
i
<
XFASTINT
(
len
);
i
++
)
{
ch
=
XVECTOR
(
this
)
->
contents
[
i
];
if
(
!
INTEGERP
(
ch
))
wrong_type_argument
(
Qintegerp
,
ch
);
leni
+=
Fchar_bytes
(
ch
);
}
else
for
(;
CONSP
(
this
);
this
=
XCONS
(
this
)
->
cdr
)
{
ch
=
XCONS
(
this
)
->
car
;
if
(
!
INTEGERP
(
ch
))
wrong_type_argument
(
Qintegerp
,
ch
);
leni
+=
Fchar_bytes
(
ch
);
}
}
else
leni
+=
XFASTINT
(
len
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment