Annotation of OpenXM_contrib2/asir2000/parse/lex.c, Revision 1.15
1.4 noro 1: /*
2: * Copyright (c) 1994-2000 FUJITSU LABORATORIES LIMITED
3: * All rights reserved.
4: *
5: * FUJITSU LABORATORIES LIMITED ("FLL") hereby grants you a limited,
6: * non-exclusive and royalty-free license to use, copy, modify and
7: * redistribute, solely for non-commercial and non-profit purposes, the
8: * computer program, "Risa/Asir" ("SOFTWARE"), subject to the terms and
9: * conditions of this Agreement. For the avoidance of doubt, you acquire
10: * only a limited right to use the SOFTWARE hereunder, and FLL or any
11: * third party developer retains all rights, including but not limited to
12: * copyrights, in and to the SOFTWARE.
13: *
14: * (1) FLL does not grant you a license in any way for commercial
15: * purposes. You may use the SOFTWARE only for non-commercial and
16: * non-profit purposes only, such as academic, research and internal
17: * business use.
18: * (2) The SOFTWARE is protected by the Copyright Law of Japan and
19: * international copyright treaties. If you make copies of the SOFTWARE,
20: * with or without modification, as permitted hereunder, you shall affix
21: * to all such copies of the SOFTWARE the above copyright notice.
22: * (3) An explicit reference to this SOFTWARE and its copyright owner
23: * shall be made on your publication or presentation in any form of the
24: * results obtained by use of the SOFTWARE.
25: * (4) In the event that you modify the SOFTWARE, you shall notify FLL by
1.5 noro 26: * e-mail at risa-admin@sec.flab.fujitsu.co.jp of the detailed specification
1.4 noro 27: * for such modification or the source code of the modified part of the
28: * SOFTWARE.
29: *
30: * THE SOFTWARE IS PROVIDED AS IS WITHOUT ANY WARRANTY OF ANY KIND. FLL
31: * MAKES ABSOLUTELY NO WARRANTIES, EXPRESSED, IMPLIED OR STATUTORY, AND
32: * EXPRESSLY DISCLAIMS ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS
33: * FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT OF THIRD PARTIES'
34: * RIGHTS. NO FLL DEALER, AGENT, EMPLOYEES IS AUTHORIZED TO MAKE ANY
35: * MODIFICATIONS, EXTENSIONS, OR ADDITIONS TO THIS WARRANTY.
36: * UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, TORT, CONTRACT,
37: * OR OTHERWISE, SHALL FLL BE LIABLE TO YOU OR ANY OTHER PERSON FOR ANY
38: * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL
39: * DAMAGES OF ANY CHARACTER, INCLUDING, WITHOUT LIMITATION, DAMAGES
40: * ARISING OUT OF OR RELATING TO THE SOFTWARE OR THIS AGREEMENT, DAMAGES
41: * FOR LOSS OF GOODWILL, WORK STOPPAGE, OR LOSS OF DATA, OR FOR ANY
42: * DAMAGES, EVEN IF FLL SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF
43: * SUCH DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY. EVEN IF A PART
44: * OF THE SOFTWARE HAS BEEN DEVELOPED BY A THIRD PARTY, THE THIRD PARTY
45: * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE,
46: * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE.
47: *
1.15 ! noro 48: * $OpenXM: OpenXM_contrib2/asir2000/parse/lex.c,v 1.14 2001/03/08 07:49:13 noro Exp $
1.4 noro 49: */
1.1 noro 50: #include <ctype.h>
51: #include "ca.h"
52: #include "al.h"
53: #include "base.h"
54: #include "parse.h"
55: #include <sys/types.h>
56: #include <sys/stat.h>
1.10 noro 57: #if defined(VISUAL)
58: #include "ytab.h"
59: #else
1.1 noro 60: #include "y.tab.h"
1.10 noro 61: #endif
1.1 noro 62:
63: extern IN asir_infile;
64: extern struct oTKWD kwd[];
65:
66: int afternl();
67: int myatoi();
68: int aftercomment();
69:
70: extern int main_parser;
71: extern char *parse_strp;
1.11 noro 72: extern int recv_intr;
1.1 noro 73:
74: static int skipspace();
75: static int Getc();
76: static void Ungetc();
77: static void Gets();
78:
1.2 noro 79: #define NBUFSIZ (BUFSIZ*10)
80: #define TBUFSIZ (BUFSIZ)
81:
82: #define REALLOC_NBUF \
83: if ( i >= nbufsize ) {\
84: nbufsize += NBUFSIZ;\
85: if ( nbuf == nbuf0 ) {\
86: nbuf = (char *)MALLOC_ATOMIC(nbufsize);\
87: bcopy(nbuf0,nbuf,nbufsize-NBUFSIZ);\
88: } else\
89: nbuf = REALLOC(nbuf,nbufsize);\
90: }
91:
92: #define REALLOC_TBUF \
93: if ( i >= tbufsize ) {\
94: tbufsize += TBUFSIZ;\
95: if ( tbuf == tbuf0 ) {\
96: tbuf = (char *)MALLOC_ATOMIC(tbufsize);\
97: bcopy(tbuf0,tbuf,tbufsize-TBUFSIZ);\
98: } else\
99: tbuf = REALLOC(tbuf,tbufsize);\
100: }
101:
102: #define READ_ALNUM_NBUF \
103: while ( 1 ) {\
104: c = Getc();\
105: if ( isalnum(c) ) {\
106: REALLOC_NBUF nbuf[i++] = c;\
107: } else\
108: break;\
109: }
110:
111: #define READ_DIGIT_NBUF \
112: while ( 1 ) {\
113: c = Getc();\
114: if ( isdigit(c) ) {\
115: REALLOC_NBUF nbuf[i++] = c;\
116: } else\
117: break;\
118: }
119:
1.1 noro 120: yylex()
121: {
122: #define yylvalp (&yylval)
123: register int c,c1;
124: register int *ptr;
125: char *cptr;
126: int d,i,j;
1.2 noro 127: char nbuf0[NBUFSIZ],tbuf0[TBUFSIZ];
128: char *nbuf, *tbuf;
129: int nbufsize, tbufsize;
1.1 noro 130: N n,n1;
131: Q q;
132: Obj r;
133:
1.2 noro 134: /* initialize buffer pointers */
135: nbuf = nbuf0; tbuf = tbuf0;
136: nbufsize = NBUFSIZ; tbufsize = TBUFSIZ;
137:
1.1 noro 138: switch ( c = skipspace() ) {
139: case EOF :
140: asir_terminate(2); break;
141: case '0' :
142: while ( ( c = Getc() ) == '0' );
143: if ( c == '.' ) {
144: Ungetc(c); c = '0';
145: } else if ( c == 'x' ) {
146: for ( i = 0; i < 8; i++ )
147: nbuf[i] = '0';
1.2 noro 148: READ_ALNUM_NBUF
149: Ungetc(c); REALLOC_NBUF nbuf[i] = 0;
1.1 noro 150: hexton(nbuf,&n1);
151: NTOQ(n1,1,q); r = (Obj)q;
152: yylvalp->p = (pointer)r;
153: return ( FORMULA );
154: } else if ( c == 'b' ) {
155: for ( i = 0; i < 32; i++ )
156: nbuf[i] = '0';
1.2 noro 157: READ_ALNUM_NBUF
158: Ungetc(c); REALLOC_NBUF nbuf[i] = 0;
1.1 noro 159: binaryton(nbuf,&n1);
160: NTOQ(n1,1,q); r = (Obj)q;
161: yylvalp->p = (pointer)r;
162: return ( FORMULA );
163: } else if ( !isdigit(c) ) {
164: yylvalp->p = 0; Ungetc(c);
165: return ( FORMULA );
166: }
167: break;
168: case '\'' :
169: for ( i = 0; ; i++ ) {
170: c = Getc();
171: if ( c == '\'' )
172: break;
173: if ( c == '\\' )
174: c = Getc();
1.2 noro 175: REALLOC_TBUF tbuf[i] = c;
1.1 noro 176: }
1.2 noro 177: REALLOC_TBUF tbuf[i] = 0;
1.1 noro 178: cptr = (char *)MALLOC(strlen(tbuf)+1); strcpy(cptr,tbuf);
179: yylvalp->p = (pointer)cptr;
180: return LCASE; break;
181: case '"' :
182: i = 0;
183: do {
184: c = Getc();
185: if ( c == '\\' ) {
186: c1 = Getc();
187: if ( c1 == 'n' )
188: c1 = '\n';
1.2 noro 189: REALLOC_NBUF nbuf[i++] = c1;
190: } else {
191: REALLOC_NBUF nbuf[i++] = c;
192: }
1.1 noro 193: } while ( c != '"' );
1.2 noro 194: nbuf[i-1] = 0; /* REALLOC_NBUF is not necessary */
1.1 noro 195: cptr = (char *)MALLOC(strlen(nbuf)+1);
196: strcpy(cptr,nbuf); yylvalp->p = (pointer) cptr;
197: return ( STR ); break;
198: case '>': case '<': case '=': case '!':
199: if ( (c1 = Getc()) == '=' )
200: switch ( c ) {
201: case '>': yylvalp->i = (int)C_GE; break;
202: case '<': yylvalp->i = (int)C_LE; break;
203: case '=': yylvalp->i = (int)C_EQ; break;
204: case '!': yylvalp->i = (int)C_NE; break;
205: default: break;
206: }
207: else if ( (c == '<' && c1 == '<') || (c == '>' && c1 == '>') )
208: return c;
209: else {
210: Ungetc(c1);
211: switch ( c ) {
212: case '>': yylvalp->i = (int)C_GT; break;
213: case '<': yylvalp->i = (int)C_LT; break;
214: default: return c; break;
215: }
216: }
217: return CMP; break;
218: case '+': case '-': case '*': case '/': case '%': case '^':
219: case '|': case '&':
220: switch ( c ) {
221: case '+': yylvalp->p = (pointer)addfs; break;
222: case '-': yylvalp->p = (pointer)subfs; break;
223: case '*': yylvalp->p = (pointer)mulfs; break;
224: case '/': yylvalp->p = (pointer)divfs; break;
225: case '%': yylvalp->p = (pointer)remfs; break;
226: case '^': yylvalp->p = (pointer)pwrfs; break;
227: default: break;
228: }
229: if ( (c1 = Getc()) == c )
230: switch ( c ) {
231: case '+': case '-': return SELF; break;
232: case '|': return OR; break;
233: case '&': return AND; break;
234: default: Ungetc(c1); return c; break;
235: }
236: else if ( c1 == '=' )
237: return BOPASS;
238: else if ( (c == '-') && (c1 == '>') )
239: return POINT;
240: else {
241: Ungetc(c1); return c;
242: }
243: break;
244: default :
245: break;
246: }
247: if ( isdigit(c) ) {
248: for ( i = 0; i < DLENGTH; i++ )
249: nbuf[i] = '0';
1.2 noro 250: REALLOC_NBUF nbuf[i++] = c;
251: READ_DIGIT_NBUF
1.1 noro 252: if ( c == '.' ) {
253: double dbl;
254: Real real;
255: double atof();
256: extern int bigfloat;
257:
1.2 noro 258: REALLOC_NBUF nbuf[i++] = c;
259: READ_DIGIT_NBUF
1.1 noro 260: if ( c == 'e' ) {
1.2 noro 261: REALLOC_NBUF nbuf[i++] = c;
262: c = Getc();
263: if ( (c == '+') || (c == '-') ) {
264: REALLOC_NBUF nbuf[i++] = c;
265: } else
266: Ungetc(c);
267: READ_DIGIT_NBUF
1.1 noro 268: }
1.2 noro 269: Ungetc(c); REALLOC_NBUF nbuf[i] = 0;
1.1 noro 270: #if PARI
271: if ( !bigfloat ) {
272: dbl = (double)atof(nbuf+DLENGTH);
273: MKReal(dbl,real); r = (Obj)real;
274: } else
275: strtobf(nbuf,(BF *)&r);
276: #else
277: dbl = (double)atof(nbuf+DLENGTH);
278: MKReal(dbl,real); r = (Obj)real;
279: #endif
280: } else {
281: Ungetc(c);
282: i -= DLENGTH; d = (i%DLENGTH?i/DLENGTH+1:i/DLENGTH);
283: n = NALLOC(d); PL(n) = d;
284: for ( j = 0, ptr = BD(n); j < d; j++ ,i -= DLENGTH )
285: ptr[j] = myatoi(nbuf+i);
286: bnton(DBASE,n,&n1);
287: NTOQ(n1,1,q); r = (Obj)q;
288: /* optobj(&r); */
289: }
290: yylvalp->p = (pointer)r;
291: return ( FORMULA );
292: } else if ( isalpha(c) ) {
1.2 noro 293: i = 0;
294: tbuf[i++] = c;
295: while ( 1 ) {
296: c = Getc();
297: if ( isalpha(c)||isdigit(c)||(c=='_') ) {
298: REALLOC_TBUF tbuf[i++] = c;
299: } else
300: break;
301: }
302: REALLOC_TBUF tbuf[i] = 0; Ungetc(c);
1.1 noro 303: if ( isupper(tbuf[0]) ) {
304: cptr = (char *)MALLOC(strlen(tbuf)+1); strcpy(cptr,tbuf);
305: yylvalp->p = (pointer)cptr;
306: return UCASE;
307: } else {
308: for ( i = 0; kwd[i].name && strcmp(tbuf,kwd[i].name); i++ );
309: if ( kwd[i].name ) {
310: yylvalp->i = asir_infile->ln;
311: return kwd[i].token;
312: } else {
313: cptr = (char *)MALLOC(strlen(tbuf)+1); strcpy(cptr,tbuf);
314: yylvalp->p = (pointer)cptr;
315: return LCASE;
316: }
317: }
318: } else if ( c == '@' ) {
319: if ( isdigit(c = Getc()) ) {
1.2 noro 320: i = 0;
321: nbuf[i++] = c;
322: READ_DIGIT_NBUF
323: Ungetc(c); REALLOC_NBUF nbuf[i] = 0;
324: yylvalp->i = atoi(nbuf);
1.1 noro 325: return ANS;
326: } else if ( c == '@' ) {
327: yylvalp->i = MAX(0,APVS->n-1);
328: return ANS;
329: } else if ( c == '>' || c == '<' || c == '=' || c == '!' ) {
330: if ( (c1 = Getc()) == '=' )
331: switch ( c ) {
332: case '>': yylvalp->i = (int)L_GE; break;
333: case '<': yylvalp->i = (int)L_LE; break;
334: case '=': yylvalp->i = (int)L_EQ; break;
335: case '!': yylvalp->i = (int)L_NE; break;
336: default: break;
337: }
338: else {
339: Ungetc(c1);
340: switch ( c ) {
341: case '>': yylvalp->i = (int)L_GT; break;
342: case '<': yylvalp->i = (int)L_LT; break;
343: case '=': yylvalp->i = (int)L_EQ; break;
344: case '!': yylvalp->i = (int)L_NOT; return FOP_NOT; break;
345: default: break;
346: }
347: }
348: return LOP;
349: } else if ( c == '|' || c == '&' ) {
350: if ( (c1 = Getc()) != c )
351: Ungetc(c1);
352: switch ( c ) {
353: case '|': yylvalp->i = (int)L_OR;
354: return FOP_OR; break;
355: case '&': yylvalp->i = (int)L_AND;
356: return FOP_AND; break;
357: }
358: } else if ( isalpha(c) ) {
1.2 noro 359: i = 0;
360: tbuf[i++] = '@';
361: tbuf[i++] = c;
362: while ( 1 ) {
363: c = Getc();
364: if ( isalpha(c) ) {
365: REALLOC_TBUF tbuf[i++] = c;
366: } else
367: break;
368: }
369: Ungetc(c); REALLOC_TBUF tbuf[i] = 0;
1.1 noro 370: if ( !strcmp(tbuf,"@p") )
371: return GFPNGEN;
372: else if ( !strcmp(tbuf,"@i") ) {
373: extern pointer IU;
374:
375: yylvalp->p = IU;
376: return FORMULA;
377: } else if ( !strcmp(tbuf,"@true") ) {
378: yylvalp->p = F_TRUE;
379: return FORMULA;
380: } else if ( !strcmp(tbuf,"@false") ) {
381: yylvalp->p = F_FALSE;
382: return FORMULA;
383: } else if ( !strcmp(tbuf,"@impl") ) {
384: yylvalp->i = (int)L_IMPL;
385: return FOP_IMPL;
386: } else if ( !strcmp(tbuf,"@repl") ) {
387: yylvalp->i = (int)L_REPL;
388: return FOP_REPL;
389: } else if ( !strcmp(tbuf,"@equiv") ) {
390: yylvalp->i = (int)L_EQUIV;
391: return FOP_EQUIV;
392: } else {
393: cptr = (char *)MALLOC(strlen(tbuf)+1); strcpy(cptr,tbuf);
394: yylvalp->p = (pointer)cptr;
395: return LCASE;
396: }
397: } else {
398: Ungetc(c);
399: return GF2NGEN;
400: }
401: } else
402: return ( c );
1.6 noro 403: }
404:
405: void purge_stdin()
406: {
1.7 noro 407: #if defined(__FreeBSD__)
1.6 noro 408: fpurge(stdin);
409: #elif defined(linux)
410: stdin->_IO_read_end = stdin->_IO_read_base;
411: stdin->_IO_read_ptr = stdin->_IO_read_base;
1.10 noro 412: #elif defined(VISUAL_LIB)
413: w_purge_stdin();
414: #elif defined(sparc) || defined(__alpha) || defined(__SVR4) || defined(mips) || defined(VISUAL)
1.6 noro 415: stdin->_ptr = stdin->_base; stdin->_cnt = 0;
1.15 ! noro 416: #elif defined(__MACH__) && defined(__ppc__)
! 417: stdin->_r = 0; stdin->_p = stdin->_bf._base;
1.6 noro 418: #else
419: --->FIXIT
420: #endif
1.1 noro 421: }
422:
423: static int skipspace() {
424: int c,c1;
425:
426: for ( c = Getc(); ; )
427: switch ( c ) {
1.14 noro 428: case ' ': case '\t': case '\r':
1.1 noro 429: c = Getc(); break;
430: case '\n':
431: c = afternl(); break;
432: case '/':
433: if ( (c1 = Getc()) == '*' )
434: c = aftercomment();
435: else {
436: Ungetc(c1); return c;
437: }
438: break;
439: default:
440: return c; break;
441: }
442: }
443:
444: int afternl() {
445: int c,ac,i,quote;
446: char *ptr;
447: char *av[BUFSIZ];
448: static int ilevel = 0;
449: char buf[BUFSIZ];
450:
451: if ( !ilevel )
452: asir_infile->ln++;
453: while ( (c = Getc()) == '#' ) {
454: Gets(buf);
455: for ( quote = 0, ptr = buf; *ptr; ptr++ )
456: if ( *ptr == '"' )
457: quote = quote ? 0 : 1;
458: else if ( quote && (*ptr == ' ') )
459: *ptr = '_';
460: stoarg(buf,&ac,av);
461: if ( ac == 3 )
462: if ( (i = atoi(av[2])) == 1 )
463: ilevel++;
464: else if ( i == 2 )
465: ilevel--;
466: if ( !ilevel )
467: asir_infile->ln = atoi(av[0]);
468: }
469: return c;
470: }
471:
472: int aftercomment() {
473: int c,c1;
474:
475: for ( c = Getc(); ; ) {
476: c1 = Getc();
477: if ( (c == '*') && (c1 == '/') )
478: return Getc();
479: else
480: c = c1;
481: }
482: }
483:
484: int myatoi(s)
485: char *s;
486: {
487: int i,r;
488: for ( i = 0, r = 0; i < DLENGTH; i++ ) r = r * 10 + ( s[i] - '0' );
489: return ( r );
490: }
491:
492: extern int ox_do_copy;
493:
494: void yyerror(s)
495: char *s;
496: {
497: if ( main_parser )
498: if ( ox_do_copy ) {
499: /* push errors to DebugStack */
500: } else {
501: if ( asir_infile->fp == stdin )
502: fprintf(stderr,"%s\n",s);
503: else
504: fprintf(stderr,"\"%s\", near line %d: %s\n",asir_infile->name,asir_infile->ln,s);
505: }
506: else
507: fprintf(stderr,"exprparse : %s\n",s);
508: }
509:
510: int echoback;
511:
512: extern int read_exec_file, do_fep, do_file;
513:
514: int readline_getc();
515: void readline_ungetc();
516: int Egetc();
517: void Eungetc();
518:
519: unsigned char encrypt_char(unsigned char);
520: unsigned char decrypt_char(unsigned char);
521:
522: int Egetc(fp)
523: FILE *fp;
524: {
525: int c;
526:
527: if ( fp ) {
1.13 noro 528: #if FEP
529: if ( do_fep && isatty(fileno(fp)) )
530: c = readline_getc();
531: else
532: #endif
533: c = getc(fp);
1.11 noro 534: #if defined(VISUAL)
535: if ( recv_intr ) {
536: #include <signal.h>
537: if ( recv_intr == 1 ) {
538: recv_intr = 0;
539: int_handler(SIGINT);
540: } else {
541: recv_intr = 0;
542: ox_usr1_handler(0);
543: }
544: }
545: #endif
1.1 noro 546: if ( c == EOF )
547: return c;
548: if ( asir_infile->encoded )
549: c = decrypt_char((unsigned char)c);
550: return c;
1.3 noro 551: } else if ( read_exec_file )
552: return EOF;
553: else {
1.1 noro 554: c = *parse_strp++;
555: if ( !c )
556: return EOF;
557: else
558: return c;
559: }
560: }
561:
562: void Eungetc(c,fp)
563: int c;
564: FILE *fp;
565: {
566: if ( fp ) {
567: if ( asir_infile->encoded )
568: c = (int)encrypt_char((unsigned char)c);
1.13 noro 569: #if FEP
570: if ( do_fep && isatty(fileno(fp)) )
571: readline_ungetc();
572: else
573: #endif
574: ungetc(c,fp);
1.1 noro 575: } else
576: *--parse_strp = c;
577: }
578:
579: static int Getc() {
580: int c;
581:
582: if ( main_parser ) {
583: while ( 1 ) {
584: if ((c = Egetc(asir_infile->fp)) == EOF)
585: if ( NEXT(asir_infile) ) {
586: closecurrentinput();
1.9 noro 587: /* if the input is the top level, generate error */
588: if ( !NEXT(asir_infile) )
589: error("end-of-file detected during parsing");
590: else
591: c = Getc();
1.1 noro 592: break;
593: } else if ( read_exec_file || do_file )
594: asir_terminate(2);
595: else {
596: if ( asir_infile->fp )
597: clearerr(asir_infile->fp);
598: }
599: else
600: break;
601: }
602: if ( echoback )
603: fputc(c,asir_out);
604: } else
605: c = *parse_strp++;
606: return ( c );
607: }
608:
609: static void Ungetc(c) {
610: if ( main_parser ) {
611: Eungetc(c,asir_infile->fp);
612: if ( echoback )
613: fputc('',asir_out);
614: } else
615: *--parse_strp = c;
616: }
617:
618: static void Gets(s)
619: char *s;
620: {
621: int c;
622:
623: while ( (c = Getc()) != '\n' )
624: *s++ = c;
625: *s = 0;
626: }
1.12 saito 627:
628: #if FEP
629:
630: static char *readline_line;
631: static int readline_nc,readline_index;
632: char *readline_console();
633:
634: int readline_getc()
635: {
636: char buf[BUFSIZ];
637:
638: if ( !readline_nc ) {
639: if ( readline_line )
640: free(readline_line);
641: sprompt(buf);
642: readline_line = readline_console(buf);
643: readline_nc = strlen(readline_line);
644: readline_index = 0;
645: }
646: readline_nc--;
647: return readline_line[readline_index++];
648: }
649:
650: void readline_ungetc()
651: {
652: readline_nc++; readline_index--;
653: }
654:
655: char *readline_console(prompt)
656: char *prompt;
657: {
658: char *line;
659: int exp_result;
660: char *expansion;
661:
662: while ( 1 ) {
663: line = (char *)readline(prompt);
664: if ( line && *line ) {
665: using_history();
666: exp_result = history_expand(line,&expansion);
667: if ( !exp_result ) {
668: free(expansion);
669: for ( ; isspace(*line); line++ );
670: add_history(line);
671: break;
672: } else if ( exp_result > 0 ) {
673: free(line);
674: line = expansion;
675: break;
676: }
677: }
678: }
679: return line;
680: }
681: #endif
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>