Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utcs!mnetor!seismo!cmcl2!rna!kc From: kc@rna.UUCP Newsgroups: net.bugs Subject: Re: gps af malfeature Message-ID: <519@rna.UUCP> Date: Wed, 16-Jul-86 13:36:07 EDT Article-I.D.: rna.519 Posted: Wed Jul 16 13:36:07 1986 Date-Received: Wed, 16-Jul-86 22:43:57 EDT References: <518@rna.UUCP> Organization: Rockefeller Neurobiology Lines: 53 In my previous posting about the af command line parameter problem my solution neglected the possibility of negative exponents. Sorry. What follows is the correct (I hope) code to improve af so that it allows scientific notation in its command line parameters. This fix supersedes the previous. *** aeparse.c.orig Tue Jul 15 17:29:33 1986 --- aeparse.c Tue Jul 15 21:55:58 1986 *************** *** 1,5 static char SCCSID[]="@(#)aeparse.c 1.2"; /* <: t-5 d :> */ #include "s.h" #include "stdio.h" --- 1,6 ----- static char SCCSID[]="@(#)aeparse.c 1.2"; /* <: t-5 d :> */ + /* kc 7/86 command line exponential notation allowed */ #include "s.h" #include "stdio.h" *************** *** 172,177 case IDENT: while( ISID(**p) || **p=='/' ) *buf++ = *(*p)++; break; case CONST: while( ISNUM(**p) ) *buf++ = *(*p)++; break; default: if(!silent) ERRPR1(? %c,*(*p)++); break; } --- 173,186 ----- case IDENT: while( ISID(**p) || **p=='/' ) *buf++ = *(*p)++; break; case CONST: while( ISNUM(**p) ) *buf++ = *(*p)++; + /* following four lines added by kc 7/86 to allow + exponents on the command line */ + if( (**p == 'e') || (**p == 'E') ) /* exponent */ + *buf++ = *(*p)++; + if( **p == '-' ) /* sign */ + *buf++ = *(*p)++; + while( ISNUM(**p) ) + *buf++ = *(*p)++; break; default: if(!silent) ERRPR1(? %c,*(*p)++); break; } Once again, sorry for the inconvenience of two messages when one should have been enough. Kaare Christian cmcl2!rna!kc