X-Git-Url: http://cloudbase.mooo.com/gitweb/z180-stamp.git/blobdiff_plain/41d36f28612cb6c49cf0260236f3b834549883be..refs/tags/hexrel-6:/avr/getopt-min.c diff --git a/avr/getopt-min.c b/avr/getopt-min.c index 778258d..f5ad912 100644 --- a/avr/getopt-min.c +++ b/avr/getopt-min.c @@ -1,7 +1,3 @@ -#include "common.h" -#include - - /* * Minimum getopt, original version was: */ @@ -14,7 +10,8 @@ */ /* $Id: getopt.c,v 1.2 1992/12/07 11:12:52 nickc Exp $ */ -#include +#include "common.h" /* definition of FLASH */ +#include int optind = 1; /* next argv[] index */ char *optarg; /* option parameter if any */ @@ -39,9 +36,9 @@ getopt( /* returns letter, '?', EOF */ || argv[optind][0] != '-' /* no more options */ || argv[optind][1] == '\0' /* not option; stdin */ ) - return EOF; + return -1; } - + c = argv[optind][sp]; /* option letter */ osp = sp++; /* get ready for next letter */ @@ -73,4 +70,3 @@ getopt( /* returns letter, '?', EOF */ return c; } -