diff options
author | Rene Engelhard <rene@openoffice.org> | 2010-05-18 14:05:20 +0200 |
---|---|---|
committer | Rene Engelhard <rene@openoffice.org> | 2010-05-18 14:05:20 +0200 |
commit | 769873c6224c0e03757d2ddb4b5a60d11411f025 (patch) | |
tree | feaa1a431c0591d0dd6d7e60bf340b8662cc9536 /soltools/javadep | |
parent | a0de0def4a49a63c6675a622123b793da8b4c78d (diff) |
systemlibc: migrate systemlibc to hg; try again from scratch
Diffstat (limited to 'soltools/javadep')
-rw-r--r-- | soltools/javadep/javadep.c | 48 |
1 files changed, 1 insertions, 47 deletions
diff --git a/soltools/javadep/javadep.c b/soltools/javadep/javadep.c index d840e6606689..cb752940941d 100644 --- a/soltools/javadep/javadep.c +++ b/soltools/javadep/javadep.c @@ -138,13 +138,6 @@ void usage(void); void err_quit(const char *, ...); void silent_quit(void); -/* poor man's getopt() */ -int simple_getopt(char *pargv[], const char *poptstring); -char *optarg = NULL; -int optind = 1; -int optopt = 0; -int opterr = 0; - uint8 read_uint8(const file_t *pfile) { @@ -731,45 +724,6 @@ usage() pprogname); } -/* my very simple minded implementation of getopt() - * it's to sad that getopt() is not available everywhere - * note: this is not a full POSIX conforming getopt() - */ -int simple_getopt(char *pargv[], const char *poptstring) -{ - char *parg = pargv[optind]; - - /* skip all response file arguments */ - if ( parg ) { - while ( *parg == '@' ) - parg = pargv[++optind]; - - if ( parg[0] == '-' && parg[1] != '\0' ) { - char *popt; - int c = parg[1]; - if ( (popt = strchr(poptstring, c)) == NULL ) { - optopt = c; - if ( opterr ) - fprintf(stderr, "Unknown option character `\\x%x'.\n", optopt); - return '?'; - } - if ( *(++popt) == ':') { - if ( parg[2] != '\0' ) { - optarg = ++parg; - } else { - optarg = pargv[++optind]; - } - } else { - optarg = NULL; - } - ++optind; - return c; - } - } - return -1; -} - - int CDECL main(int argc, char *argv[]) { @@ -817,7 +771,7 @@ main(int argc, char *argv[]) opterr = 0; pincs = allocate_growable(); - while( (c = simple_getopt(pall_argv, ":i:I:s:S:o:OhHvV")) != -1 ) { + while( (c = getopt(nall_argc, pall_argv, ":i:I:s:S:o:OhHvV")) != -1 ) { switch(c) { case 'i': case 'I': |