Fix accidental glibc dependency.

fltkmain accidentally used optind instead of optndx. optind is
defined as an extern int in glibc but not on BSD systems.
This also broke passing a filename on command line.
pull/3/head
whitequark 2015-03-17 19:22:56 +03:00
parent 604c4bbea3
commit 1bbf61b8a2
1 changed files with 2 additions and 2 deletions

View File

@ -1304,8 +1304,8 @@ int main(int argc, char **argv)
// A filename may have been specified on the command line; if so, then // A filename may have been specified on the command line; if so, then
// make it absolute. // make it absolute.
char file[MAX_PATH] = ""; char file[MAX_PATH] = "";
if(optind < argc && strlen(argv[optind])+1 < MAX_PATH) { if(optndx < argc && strlen(argv[optndx])+1 < MAX_PATH) {
strcpy(file, argv[optind]); strcpy(file, argv[optndx]);
} }
if(*file != '\0') { if(*file != '\0') {
GetAbsoluteFilename(file); GetAbsoluteFilename(file);