The R Project SVN R

Rev

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

Rev 37398 Rev 37439
Line 732... Line 732...
732
	    else {
732
	    else {
733
		char *q = CHAR(STRING_ELT(sformat, i%m)), buf2[500];
733
		char *q = CHAR(STRING_ELT(sformat, i%m)), buf2[500];
734
		strcpy(buf2,  q);
734
		strcpy(buf2,  q);
735
		p = strstr(q, "%OS");
735
		p = strstr(q, "%OS");
736
		if(p) {
736
		if(p) {
737
		    int ns = 3;
737
		    int ns, nused = 4;
738
		    char *p2 = strstr(buf2, "%OS");
738
		    char *p2 = strstr(buf2, "%OS");
739
		    *p2 = '\0';
739
		    *p2 = '\0';
740
		    ns = *(p+3) - '0';
740
		    ns = *(p+3) - '0';
-
 
741
		    if(ns < 0 || ns > 9) { /* not a digit */
-
 
742
			ns = asInteger(GetOption(install("digits.secs"),
-
 
743
						 R_BaseEnv));
-
 
744
			if(ns == NA_INTEGER) ns = 0;
-
 
745
			nused = 3;
-
 
746
		    }
741
		    if(ns > 6) ns = 6;
747
		    if(ns > 6) ns = 6;
742
		    if(ns < 1) ns = 1;
748
		    if(ns > 0) {
743
		    sprintf(p2, "%0*.*f", ns+3, ns, secs);
749
			sprintf(p2, "%0*.*f", ns+3, ns, secs);
744
		    strcat(buf2, p+4);
750
			strcat(buf2, p+nused);
-
 
751
		    } else {
-
 
752
			strcat(p2, "%S");
-
 
753
			strcat(buf2, p+nused);
-
 
754
		    }
745
		}
755
		}
746
		strftime(buff, 256, buf2, &tm);
756
		strftime(buff, 256, buf2, &tm);
747
		if(UseTZ && !isNull(tz)) {
757
		if(UseTZ && !isNull(tz)) {
748
		    int i = 0;
758
		    int i = 0;
749
		    if(LENGTH(tz) == 3) {
759
		    if(LENGTH(tz) == 3) {