Subversion Repositories wimsdev

Rev

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

Rev 8305 Rev 8312
Line 3676... Line 3676...
3676
double get_real(FILE *infile, int last){ /* accept anything that looks like an number ?  last = 0 : more arguments ; last=1 final argument */
3676
double get_real(FILE *infile, int last){ /* accept anything that looks like an number ?  last = 0 : more arguments ; last=1 final argument */
3677
    int c,i=0,found_calc = 0;
3677
    int c,i=0,found_calc = 0;
3678
    double y;
3678
    double y;
3679
    char tmp[MAX_INT];
3679
    char tmp[MAX_INT];
3680
    /* these things are 'allowed functions' : *,^,+,-,/,(,),e,arc,cos,tan,pi,log,ln */
3680
    /* these things are 'allowed functions' : *,^,+,-,/,(,),e,arc,cos,tan,pi,log,ln */
3681
    const char *allowed = "earcostanpilog+-/^()";/* assuming these are allowed stuff in a 'number'*/
3681
    const char *allowed = "earcostanpilog*+-/^()";/* assuming these are allowed stuff in a 'number'*/
3682
    const char *not_allowed = "#bdfghjkmquvwxyz";/* avoid segmentation faults in a "atof()" and "wims eval" */
3682
    const char *not_allowed = "#bdfghjkmquvwxyz";/* avoid segmentation faults in a "atof()" and "wims eval" */
3683
    while(( (c=getc(infile)) != EOF ) && ( c != ',') && (c != '\n') && ( c != ';')){
3683
    while(( (c=getc(infile)) != EOF ) && ( c != ',') && (c != '\n') && ( c != ';')){
3684
     if( c != ' ' ){
3684
     if( c != ' ' ){
3685
      if( i == 0 &&  c == '+' ){
3685
      if( i == 0 &&  c == '+' ){
3686
       continue;
3686
       continue;