The R Project SVN R

Rev

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

Rev 90283 Rev 90285
Line 616... Line 616...
616
	REprintf("%s\n", header);
616
	REprintf("%s\n", header);
617
	names = CAR(ATTRIB(R_Warnings));
617
	names = CAR(ATTRIB(R_Warnings));
618
	if( VECTOR_ELT(R_Warnings, 0) == R_NilValue )
618
	if( VECTOR_ELT(R_Warnings, 0) == R_NilValue )
619
	    REprintf("%s \n", CHAR(STRING_ELT(names, 0)));
619
	    REprintf("%s \n", CHAR(STRING_ELT(names, 0)));
620
	else {
620
	else {
621
	    const char *dcall, *msg = CHAR(STRING_ELT(names, 0));
621
	    const char *msg = CHAR(STRING_ELT(names, 0));
622
	    dcall = CHAR(STRING_ELT(deparse1s(VECTOR_ELT(R_Warnings, 0)), 0));
622
	    const char *dcall = CHAR(STRING_ELT(deparse1s(VECTOR_ELT(R_Warnings, 0)), 0));
623
	    REprintf(_("In %s :"), dcall);
623
	    REprintf(_("In %s :"), dcall);
624
	    if (mbcslocale) {
624
	    if (mbcslocale) {
625
		int msgline1;
625
		int msgline1;
626
		char *p = (char *) strchr(msg, '\n');
626
		if (strchr(msg, '\n')) {
-
 
627
		    // this branch alters msg temporarily
-
 
628
		    char msg1[strlen(msg)];
627
		if (p) {
629
		    strcpy(msg1, msg);
-
 
630
		    char *p = strchr(msg1, '\n');
628
		    *p = '\0';
631
		    *p = '\0';
629
		    msgline1 = wd(msg);
632
		    msgline1 = wd(msg1);
630
		    *p = '\n';
-
 
631
		} else msgline1 = wd(msg);
633
		} else msgline1 = wd(msg);
632
		if (6 + wd(dcall) + msgline1 > LONGWARN) REprintf("\n ");
634
		if (6 + wd(dcall) + msgline1 > LONGWARN) REprintf("\n ");
-
 
635
		REprintf(" %s\n", msg);
633
	    } else {
636
	    } else {
634
		size_t msgline1 = strlen(msg);
637
		size_t msgline1 = strlen(msg);
635
		char *p = (char *)strchr(msg, '\n');
638
		const char *p = strchr(msg, '\n');
636
		if (p) msgline1 = (int)(p - msg);
639
		if (p) msgline1 = (int)(p - msg);
637
		if (6 + strlen(dcall) + msgline1 > LONGWARN) REprintf("\n ");
640
		if (6 + strlen(dcall) + msgline1 > LONGWARN) REprintf("\n ");
-
 
641
		REprintf(" %s\n", msg);
638
	    }
642
	    }
639
	    REprintf(" %s\n", msg);
-
 
640
	}
643
	}
641
    } else if( R_CollectWarnings <= 10 ) {
644
    } else if( R_CollectWarnings <= 10 ) {
642
	REprintf("%s\n", header);
645
	REprintf("%s\n", header);
643
	names = CAR(ATTRIB(R_Warnings));
646
	names = CAR(ATTRIB(R_Warnings));
644
	for(i = 0; i < R_CollectWarnings; i++) {
647
	for(i = 0; i < R_CollectWarnings; i++) {