]> cloudbase.mooo.com Git - z180-stamp.git/blobdiff - avr/getopt-min.c
f_sync only, when timout (currently 1s) after last write operation.
[z180-stamp.git] / avr / getopt-min.c
index 778258d52b9f9790e7d34dc33a45415e7527423c..f5ad912f281e1a73085160f6282e9754e04d1bea 100644 (file)
@@ -1,7 +1,3 @@
-#include "common.h"
-#include <avr/pgmspace.h>
-
-
 /*
  *     Minimum getopt, original version was:
  */
@@ -14,7 +10,8 @@
 */
 /* $Id: getopt.c,v 1.2 1992/12/07 11:12:52 nickc Exp $ */
 
-#include       <string.h>
+#include "common.h"            /* definition of FLASH */
+#include <string.h>
 
 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;
 }
-