Changeset 945


Ignore:
Timestamp:
Jan 11, 2004, 4:18:28 PM (22 years ago)
Author:
bird
Message:

Use the getopt_long.c getopt().

Location:
trunk/src/emx/src/lib/bsd/stdlib
Files:
1 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/src/lib/bsd/stdlib/getopt_long.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r944 r945  
    5252#include <string.h>
    5353
     54#ifdef __EMX__
     55#define REPLACE_GETOPT
     56#endif
     57
    5458/* not part of the original file */
    5559#ifndef _DIAGASSERT
     
    130134                c = a % b;
    131135        }
    132            
     136       
    133137        return b;
    134138}
     
    231235                        if (IN_ORDER) {
    232236                                /*
    233                                  * GNU extension: 
     237                                 * GNU extension:
    234238                                 * return non-option as argument to option 1
    235239                                 */
     
    277281        if (optchar == 'W' && oli[1] == ';') {          /* -W long-option */
    278282                /* XXX: what if no long options provided (called by getopt)? */
    279                 if (*place) 
     283                if (*place)
    280284                        return -2;
    281285
     
    327331 */
    328332int
    329 getopt(nargc, nargv, options)
     333_STD(getopt)(nargc, nargv, options)
    330334        int nargc;
    331335        char * const *nargv;
     
    404408                } else
    405409                        current_argv_len = strlen(current_argv);
    406            
     410       
    407411                for (i = 0; long_options[i].name; i++) {
    408412                        /* find matching long option */
     
    485489                        *long_options[match].flag = long_options[match].val;
    486490                        retval = 0;
    487                 } else 
     491                } else
    488492                        retval = long_options[match].val;
    489493                if (idx)
Note: See TracChangeset for help on using the changeset viewer.