Ignore #pragma tabsize with non-positive arguments
#pragma tabsize X will now have no effect for X <= 0. Same goes for the -t option (will display usage instead). Closes #24.
This commit is contained in:
parent
e793429700
commit
7f30a03f94
@ -1098,7 +1098,11 @@ static void parseoptions(int argc,char **argv,char *oname,char *ename,char *pnam
|
|||||||
skipinput=atoi(option_value(ptr));
|
skipinput=atoi(option_value(ptr));
|
||||||
break;
|
break;
|
||||||
case 't':
|
case 't':
|
||||||
sc_tabsize=atoi(option_value(ptr));
|
i=atoi(option_value(ptr));
|
||||||
|
if (i>0)
|
||||||
|
sc_tabsize=i;
|
||||||
|
else
|
||||||
|
about();
|
||||||
break;
|
break;
|
||||||
case 'v':
|
case 'v':
|
||||||
verbosity= isdigit(*option_value(ptr)) ? atoi(option_value(ptr)) : 2;
|
verbosity= isdigit(*option_value(ptr)) ? atoi(option_value(ptr)) : 2;
|
||||||
|
@ -1144,7 +1144,8 @@ static int command(void)
|
|||||||
} else if (strcmp(str,"tabsize")==0) {
|
} else if (strcmp(str,"tabsize")==0) {
|
||||||
cell val;
|
cell val;
|
||||||
preproc_expr(&val,NULL);
|
preproc_expr(&val,NULL);
|
||||||
sc_tabsize=(int)val;
|
if (val>0)
|
||||||
|
sc_tabsize=(int)val;
|
||||||
} else if (strcmp(str,"align")==0) {
|
} else if (strcmp(str,"align")==0) {
|
||||||
sc_alignnext=TRUE;
|
sc_alignnext=TRUE;
|
||||||
} else if (strcmp(str,"unused")==0) {
|
} else if (strcmp(str,"unused")==0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user