mirror of
https://github.com/mdbtools/mdbtools.git
synced 2025-04-05 20:31:00 +08:00
Use correct index for command line options
This commit is contained in:
parent
c6300ecf16
commit
c8a0c79e31
@ -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>
|
||||
* include/mdbtools.h:
|
||||
* src/libmdb/iconv.h: Use size_t instead of unsigned int for calling iconv
|
||||
|
@ -35,10 +35,6 @@ main(int argc, char **argv)
|
||||
int col_num;
|
||||
int found = 0;
|
||||
|
||||
/*
|
||||
** optind is now the position of the first non-option arg,
|
||||
** see getopt(3)
|
||||
*/
|
||||
if (argc < 2) {
|
||||
fprintf(stderr,"Usage: %s <file> <name> [<prop col>]\n",argv[0]);
|
||||
return 1;
|
||||
@ -46,7 +42,7 @@ main(int argc, char **argv)
|
||||
|
||||
mdb_init();
|
||||
|
||||
if (!(mdb = mdb_open(argv[optind], MDB_NOFLAGS))) {
|
||||
if (!(mdb = mdb_open(argv[1], MDB_NOFLAGS))) {
|
||||
mdb_exit();
|
||||
return 1;
|
||||
}
|
||||
@ -54,11 +50,11 @@ main(int argc, char **argv)
|
||||
mdb_read_columns(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);
|
||||
|
||||
while(mdb_fetch_row(table)) {
|
||||
if (!strcmp(name, argv[optind+1])) {
|
||||
if (!strcmp(name, argv[2])) {
|
||||
found = 1;
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user