The R Project SVN R

Rev

Rev 62995 | Rev 64212 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 62995 Rev 63181
Line 482... Line 482...
482
    SEXP ans;
482
    SEXP ans;
483
    char *cbuf;
483
    char *cbuf;
484
    base = EnsureString(base);
484
    base = EnsureString(base);
485
    tag = EnsureString(tag);
485
    tag = EnsureString(tag);
486
    if (*CHAR(base) && *CHAR(tag)) { /* test of length */
486
    if (*CHAR(base) && *CHAR(tag)) { /* test of length */
-
 
487
	const void *vmax = vmaxget();
487
	const char *sb = translateCharUTF8(base), *st = translateCharUTF8(tag);
488
	const char *sb = translateCharUTF8(base), *st = translateCharUTF8(tag);
488
	cbuf = R_AllocStringBuffer(strlen(st) + strlen(sb) + 1, &cbuff);
489
	cbuf = R_AllocStringBuffer(strlen(st) + strlen(sb) + 1, &cbuff);
489
	sprintf(cbuf, "%s.%s", sb, st);
490
	sprintf(cbuf, "%s.%s", sb, st);
490
	/* This isn't strictly correct as we do not know that all the
491
	/* This isn't strictly correct as we do not know that all the
491
	   components of the name were correctly translated. */
492
	   components of the name were correctly translated. */
492
	ans = mkCharCE(cbuf, CE_UTF8);
493
	ans = mkCharCE(cbuf, CE_UTF8);
-
 
494
	vmaxset(vmax);
493
    }
495
    }
494
    else if (*CHAR(tag)) {
496
    else if (*CHAR(tag)) {
495
	ans = tag;
497
	ans = tag;
496
    }
498
    }
497
    else if (*CHAR(base)) {
499
    else if (*CHAR(base)) {
Line 510... Line 512...
510
 *
512
 *
511
 */
513
 */
512
 
514
 
513
    SEXP ans;
515
    SEXP ans;
514
    char *cbuf;
516
    char *cbuf;
-
 
517
    const void *vmax = vmaxget();
-
 
518
 
515
    base = EnsureString(base);
519
    base = EnsureString(base);
516
    tag = EnsureString(tag);
520
    tag = EnsureString(tag);
517
    if (*CHAR(base) && *CHAR(tag)) {
521
    if (*CHAR(base) && *CHAR(tag)) {
518
	const char *sb = translateCharUTF8(base), *st = translateCharUTF8(tag);
522
	const char *sb = translateCharUTF8(base), *st = translateCharUTF8(tag);
519
	cbuf = R_AllocStringBuffer(strlen(sb) + strlen(st) + 1, &cbuff);
523
	cbuf = R_AllocStringBuffer(strlen(sb) + strlen(st) + 1, &cbuff);
Line 535... Line 539...
535
	    sprintf(cbuf, "%s", st);
539
	    sprintf(cbuf, "%s", st);
536
	    ans = mkCharCE(cbuf, CE_UTF8);
540
	    ans = mkCharCE(cbuf, CE_UTF8);
537
	}
541
	}
538
    }
542
    }
539
    else ans = R_BlankString;
543
    else ans = R_BlankString;
-
 
544
    vmaxset(vmax);
540
    return ans;
545
    return ans;
541
}
546
}
542
 
547
 
543
/* also used in coerce.c */
548
/* also used in coerce.c */
544
SEXP attribute_hidden ItemName(SEXP names, R_xlen_t i)
549
SEXP attribute_hidden ItemName(SEXP names, R_xlen_t i)