The R Project SVN R

Rev

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

Rev 35625 Rev 35703
Line 33... Line 33...
33
    char *formatString, *starc;
33
    char *formatString, *starc;
34
    char fmt[MAXLINE+1], bit[MAXLINE+1], outputString[MAXLINE+1];
34
    char fmt[MAXLINE+1], bit[MAXLINE+1], outputString[MAXLINE+1];
35
    size_t n, cur, chunk;
35
    size_t n, cur, chunk;
36
 
36
 
37
    SEXP format, ans, this, a[100], tmp;
37
    SEXP format, ans, this, a[100], tmp;
38
    int ns, maxlen, lens[100], nthis, has_star, star_arg, nstar;
38
    int ns, maxlen, lens[100], nthis, has_star, star_arg = 0, nstar;
39
 
39
 
40
    /* grab the format string */
40
    /* grab the format string */
41
 
41
 
42
    nargs = length(args);
42
    nargs = length(args);
43
    format = CAR(args);
43
    format = CAR(args);
Line 146... Line 146...
146
			if(TYPEOF(this) == REALSXP)
146
			if(TYPEOF(this) == REALSXP)
147
			    this = coerceVector(this, INTSXP);
147
			    this = coerceVector(this, INTSXP);
148
			if(TYPEOF(this) != INTSXP || LENGTH(this)<1 ||
148
			if(TYPEOF(this) != INTSXP || LENGTH(this)<1 ||
149
			   INTEGER(this)[ns % LENGTH(this)] == NA_INTEGER)
149
			   INTEGER(this)[ns % LENGTH(this)] == NA_INTEGER)
150
			    errorcall(call, _("argument for `*' conversion specification must be a number"));
150
			    errorcall(call, _("argument for `*' conversion specification must be a number"));
151
			has_star=1;
151
			has_star = 1;
152
			star_arg=INTEGER(this)[ns % LENGTH(this)];
152
			star_arg = INTEGER(this)[ns % LENGTH(this)];
153
		    }
153
		    }
154
 
154
 
155
		    if (fmt[strlen(fmt) - 1] == '%') {
155
		    if (fmt[strlen(fmt) - 1] == '%') {
156
			/* handle % with formatting options */
156
			/* handle % with formatting options */
157
			if (has_star)
157
			if (has_star)