Fix mistake: fuzzy matching is 5=103, not 5=102
[yaz-moved-to-github.git] / src / options.c
index 4f86d83..c91e7f0 100644 (file)
@@ -1,8 +1,8 @@
 /*
- * Copyright (c) 1995-2004, Index Data
+ * Copyright (C) 1995-2005, Index Data ApS
  * See the file LICENSE for details.
  *
- * $Id: options.c,v 1.2 2004-10-15 00:19:00 adam Exp $
+ * $Id: options.c,v 1.4 2005-06-25 15:46:04 adam Exp $
  */
 /**
  * \file options.c
@@ -46,44 +46,52 @@ int options (const char *desc, char **argv, int argc, char **arg)
         int desc_char = desc[i++];
         int type = 0;
         if (desc[i] == ':')
-       {       /* string argument */
+        {       /* string argument */
             type = desc[i++];
-       }
+        }
         if (desc_char == ch)
-       { /* option with argument */
+        { /* option with argument */
             if (type)
-           {
+            {
                 if (argv[arg_no][arg_off])
-               {
+                {
                     *arg = argv[arg_no]+arg_off;
                     arg_no++;
                     arg_off =  0;
-               }
+                }
                 else
-               {
+                {
                     arg_no++;
                     arg_off = 0;
                     if (arg_no < argc)
                         *arg = argv[arg_no++];
                     else
                         *arg = "";
-               }
-           }
+                }
+            }
             else /* option with no argument */
-           {
+            {
                 if (argv[arg_no][arg_off])
                     arg_off++;
                 else
-               {
+                {
                     arg_off = 0;
                     arg_no++;
-               }
-           }
+                }
+            }
             return ch;
-       }               
+        }               
     }
     *arg = argv[arg_no]+arg_off-1;
     arg_no = arg_no + 1;
     arg_off = 0;
     return -1;
 }
+/*
+ * Local variables:
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ * vim: shiftwidth=4 tabstop=8 expandtab
+ */
+