Annotation of researchv10no/cmd/basic/bite/src/getfnam.c, revision 1.1.1.1

1.1       root        1: /* Copyright Bell Telephone Laboratories Whippany, N.J.
                      2: 
                      3:  *     ***********************************
                      4:  *     ***********************************
                      5:  *     ********* GET A FILE NAME *********
                      6:  *     *** R. B. Drake WH 8C-005 X4163 ***
                      7:  *     **** Fri Aug 24 17:28:41 1979 *****
                      8:  *     ***********************************
                      9:  *     ***********************************
                     10:  * When the user types a command which needs a filename such as
                     11:  * "old" or "save" or "load", and no default filename currently
                     12:  * exists, this routine is called to prompt the user for one
                     13: 
                     14: */
                     15: /*   "@(#) getfnam.c:  V 1.1  12/21/80" */
                     16: 
                     17: #include "bas.h"
                     18: extern char filnam[];
                     19: getfnam()
                     20: {
                     21:        int i;
                     22:        while(expr[0] == '\0' && filnam[0] == '\0')
                     23:        {
                     24:                printf("Filename ?");
                     25:                fgets(filnam,40,stdin);
                     26:                i = strlen(filnam);
                     27:                postb(filnam);
                     28:                if(i>=40)
                     29:                {
                     30:                        printf("NAME TOO LONG, TRY AGAIN\n");
                     31:                        filnam[0]='\0';
                     32:                        continue;
                     33:                }
                     34:                break;
                     35:        }
                     36:        return(0);
                     37: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.