projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed bug #779: Rotation of apdu.log fails.
[yaz-moved-to-github.git]
/
src
/
options.c
diff --git
a/src/options.c
b/src/options.c
index
a08b184
..
c91e7f0
100644
(file)
--- a/
src/options.c
+++ b/
src/options.c
@@
-2,7
+2,7
@@
* Copyright (C) 1995-2005, Index Data ApS
* See the file LICENSE for details.
*
* Copyright (C) 1995-2005, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: options.c,v 1.3 2005-01-15 19:47:14 adam Exp $
+ * $Id: options.c,v 1.4 2005-06-25 15:46:04 adam Exp $
*/
/**
* \file options.c
*/
/**
* \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] == ':')
int desc_char = desc[i++];
int type = 0;
if (desc[i] == ':')
- { /* string argument */
+ { /* string argument */
type = desc[i++];
type = desc[i++];
- }
+ }
if (desc_char == ch)
if (desc_char == ch)
- { /* option with argument */
+ { /* option with argument */
if (type)
if (type)
- {
+ {
if (argv[arg_no][arg_off])
if (argv[arg_no][arg_off])
- {
+ {
*arg = argv[arg_no]+arg_off;
arg_no++;
arg_off = 0;
*arg = argv[arg_no]+arg_off;
arg_no++;
arg_off = 0;
- }
+ }
else
else
- {
+ {
arg_no++;
arg_off = 0;
if (arg_no < argc)
*arg = argv[arg_no++];
else
*arg = "";
arg_no++;
arg_off = 0;
if (arg_no < argc)
*arg = argv[arg_no++];
else
*arg = "";
- }
- }
+ }
+ }
else /* option with no argument */
else /* option with no argument */
- {
+ {
if (argv[arg_no][arg_off])
arg_off++;
else
if (argv[arg_no][arg_off])
arg_off++;
else
- {
+ {
arg_off = 0;
arg_no++;
arg_off = 0;
arg_no++;
- }
- }
+ }
+ }
return ch;
return ch;
- }
+ }
}
*arg = argv[arg_no]+arg_off-1;
arg_no = arg_no + 1;
arg_off = 0;
return -1;
}
}
*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
+ */
+