mirror of
https://github.com/mdbtools/mdbtools.git
synced 2026-03-10 00:20:54 +08:00
Use correct index for command line options
This commit is contained in:
@@ -1,3 +1,6 @@
|
|||||||
|
Tue Aug 9 23:36:01 CDT 2005 Jeff Smith <whydoubt@yahoo.com>
|
||||||
|
* src/util/mdb-prop.c: Use correct index for command line options
|
||||||
|
|
||||||
Fri Aug 5 10:49:57 CDT 2005 Jeff Smith <whydoubt@yahoo.com>
|
Fri Aug 5 10:49:57 CDT 2005 Jeff Smith <whydoubt@yahoo.com>
|
||||||
* include/mdbtools.h:
|
* include/mdbtools.h:
|
||||||
* src/libmdb/iconv.h: Use size_t instead of unsigned int for calling iconv
|
* src/libmdb/iconv.h: Use size_t instead of unsigned int for calling iconv
|
||||||
|
|||||||
+3
-7
@@ -35,10 +35,6 @@ main(int argc, char **argv)
|
|||||||
int col_num;
|
int col_num;
|
||||||
int found = 0;
|
int found = 0;
|
||||||
|
|
||||||
/*
|
|
||||||
** optind is now the position of the first non-option arg,
|
|
||||||
** see getopt(3)
|
|
||||||
*/
|
|
||||||
if (argc < 2) {
|
if (argc < 2) {
|
||||||
fprintf(stderr,"Usage: %s <file> <name> [<prop col>]\n",argv[0]);
|
fprintf(stderr,"Usage: %s <file> <name> [<prop col>]\n",argv[0]);
|
||||||
return 1;
|
return 1;
|
||||||
@@ -46,7 +42,7 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
mdb_init();
|
mdb_init();
|
||||||
|
|
||||||
if (!(mdb = mdb_open(argv[optind], MDB_NOFLAGS))) {
|
if (!(mdb = mdb_open(argv[1], MDB_NOFLAGS))) {
|
||||||
mdb_exit();
|
mdb_exit();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -54,11 +50,11 @@ main(int argc, char **argv)
|
|||||||
mdb_read_columns(table);
|
mdb_read_columns(table);
|
||||||
mdb_rewind_table(table);
|
mdb_rewind_table(table);
|
||||||
|
|
||||||
col_num = mdb_bind_column_by_name(table, argv[optind+2], buf, NULL);
|
col_num = mdb_bind_column_by_name(table, argv[3], buf, NULL);
|
||||||
mdb_bind_column_by_name(table, "Name", name, NULL);
|
mdb_bind_column_by_name(table, "Name", name, NULL);
|
||||||
|
|
||||||
while(mdb_fetch_row(table)) {
|
while(mdb_fetch_row(table)) {
|
||||||
if (!strcmp(name, argv[optind+1])) {
|
if (!strcmp(name, argv[2])) {
|
||||||
found = 1;
|
found = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user