From e3a7b20c1d25019175718e66ed95b56a08d57807 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 3 Jul 2009 00:53:20 +0200 Subject: Use fz_getopt & co. --- apps/pdfshow.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'apps/pdfshow.c') diff --git a/apps/pdfshow.c b/apps/pdfshow.c index 994a885c..44d50774 100644 --- a/apps/pdfshow.c +++ b/apps/pdfshow.c @@ -181,11 +181,11 @@ int main(int argc, char **argv) char *password = ""; int c; - while ((c = getopt(argc, argv, "d:bx")) != -1) + while ((c = fz_getopt(argc, argv, "d:bx")) != -1) { switch (c) { - case 'd': password = optarg; break; + case 'd': password = fz_optarg; break; case 'b': showbinary ++; break; case 'x': showdecode ++; break; default: @@ -194,23 +194,23 @@ int main(int argc, char **argv) } } - if (optind == argc) + if (fz_optind == argc) showusage(); - openxref(argv[optind++], password); + openxref(argv[fz_optind++], password); - if (optind == argc) + if (fz_optind == argc) showtrailer(); - while (optind < argc) + while (fz_optind < argc) { - if (!strcmp(argv[optind], "trailer")) + if (!strcmp(argv[fz_optind], "trailer")) showtrailer(); - else if (!strcmp(argv[optind], "xref")) + else if (!strcmp(argv[fz_optind], "xref")) showxref(); else - showobject(atoi(argv[optind]), 0); - optind++; + showobject(atoi(argv[fz_optind]), 0); + fz_optind++; } closexref(); -- cgit v1.2.3