Skip to content

Commit f44ba06

Browse files
author
maechler
committed
fix typo <=> PR#18935 (+ cosmetic)
git-svn-id: https://svn.r-project.org/R/trunk@88666 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 1f2c6a6 commit f44ba06

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/main/character.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ Comparison is done directly unless you happen to be comparing the same
4444
string in different encodings.
4545
4646
nzchar and nchar(, "bytes") are independent of the encoding
47-
nchar(, "char") nchar(, "width") handle UTF-8 and Latin-1 directly
47+
nchar(, "char") nchar(, "width") handle UTF-8 and Latin-1 directly
4848
substr substr<- handle UTF-8 and Latin-1 directly
49-
tolower toupper chartr translate UTF-8 and Latin-1 to wchar (which needs
49+
tolower toupper chartr translate UTF-8 and Latin-1 to wchar (which needs
5050
Unicode wide characters), rest to current charset
5151
abbreviate translates non-ASCII inputs to UTF-8 then wchar_t*.
5252
strtrim translates to the native encoding
@@ -346,7 +346,7 @@ attribute_hidden SEXP do_nchar(SEXP call, SEXP op, SEXP args, SEXP env)
346346
switch(res) {
347347
case -1:
348348
error(_("invalid multibyte string, element %lld"), (long long)i+1);
349-
case -2:
349+
case -2:
350350
if (type_ == Chars)
351351
error(_("number of characters is not computable in \"bytes\" encoding, element %lld"),
352352
(long long)i+1);
@@ -425,14 +425,13 @@ static void substr(const char *str, int len, int ienc, int sa, int so,
425425
attribute_hidden SEXP
426426
do_substr(SEXP call, SEXP op, SEXP args, SEXP env)
427427
{
428-
SEXP s, x;
429428
checkArity(op, args);
430-
x = CAR(args);
429+
SEXP x = CAR(args);
431430
if (!isString(x))
432431
error(_("extracting substrings from a non-character object"));
433432
R_xlen_t len = XLENGTH(x);
434-
PROTECT(s = allocVector(STRSXP, len));
435-
SEXP lastel = NULL;
433+
SEXP s = PROTECT(allocVector(STRSXP, len)),
434+
lastel = NULL;
436435
if (len > 0) {
437436
SEXP sa = CADR(args),
438437
so = CADDR(args);
@@ -825,7 +824,7 @@ static SEXP stripchars(const char * const inchar, int minlen, int usecl)
825824
// lower-case vowels in English plus accented versions
826825
static int vowels[] = {
827826
0x61, 0x65, 0x69, 0x6f, 0x75,
828-
0xe0, 0xe1, 0x2e, 0xe3, 0xe4, 0xe5,
827+
0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5,
829828
0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
830829
0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc,
831830
0x101, 0x103, 0x105, 0x113, 0x115, 0x117, 0x118, 0x11b,
@@ -1155,7 +1154,7 @@ attribute_hidden SEXP do_tolower(SEXP call, SEXP op, SEXP args, SEXP env)
11551154
wc[j] = Ri18n_towlower(wc[j]);
11561155
#else
11571156
/* This cannot cope with surrogate pairs,
1158-
if mbstowcs can make them. */
1157+
if mbstowcs can make them. */
11591158
for (j = 0; j < nc; j++) wc[j] = towctrans(wc[j], tr);
11601159
#endif
11611160
nb = (int) wcstombs(NULL, wc, 0);

0 commit comments

Comments
 (0)