Bug 331818 xpidl crashes when no file name is given on the command line

patch by mh+mozilla@glandium.org changes per dbradley r=timeless sr=shaver
This commit is contained in:
timeless%mozdev.org 2006-05-06 23:39:09 +00:00
Родитель a80b0a650e
Коммит bd0c85a467
1 изменённых файлов: 10 добавлений и 4 удалений

Просмотреть файл

@ -277,15 +277,21 @@ int main(int argc, char *argv[])
xpidl_usage(argc, argv);
return 1;
}
if (argc != i + 1) {
fprintf(stderr, "ERROR: extra arguments after input file\n");
}
/*
* Don't try to process multiple files, given that we don't handle -o
* multiply.
*/
i = xpidl_process_idl(argv[i], inc_head, file_basename, mode);
if (i < argc) {
i = xpidl_process_idl(argv[i], inc_head, file_basename, mode);
} else {
if (argc > i + 1) {
fprintf(stderr, "ERROR: extra arguments after input file\n");
} else {
fprintf(stderr, "ERROR: no file to process\n");
}
return 1;
}
if (deps) {
fprintf(deps, "\n");