diff options
Diffstat (limited to 'contrib/ncurses/progs')
-rw-r--r-- | contrib/ncurses/progs/infocmp.c | 8 | ||||
-rw-r--r-- | contrib/ncurses/progs/toe.c | 17 |
2 files changed, 15 insertions, 10 deletions
diff --git a/contrib/ncurses/progs/infocmp.c b/contrib/ncurses/progs/infocmp.c index 9b74ba00d542..8680df35d34f 100644 --- a/contrib/ncurses/progs/infocmp.c +++ b/contrib/ncurses/progs/infocmp.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -42,7 +42,7 @@ #include <dump_entry.h> -MODULE_ID("$Id: infocmp.c,v 1.94 2007/11/17 23:34:26 tom Exp $") +MODULE_ID("$Id: infocmp.c,v 1.96 2008/01/19 21:08:07 tom Exp $") #define L_CURL "{" #define R_CURL "}" @@ -1215,6 +1215,8 @@ dump_termtype(TERMTYPE *term) NUM_STRINGS(term) - STRCOUNT); (void) printf("#endif /* NCURSES_XNAMES */\n"); +#else + (void) term; #endif /* NCURSES_XNAMES */ (void) printf("\t%s\n", R_CURL); } @@ -1450,7 +1452,7 @@ main(int argc, char *argv[]) } } - maxterms = (argc + 1 - optind); + maxterms = (argc + 2 - optind); tfile = typeMalloc(path, maxterms); tname = typeCalloc(char *, maxterms); entries = typeCalloc(ENTRY, maxterms); diff --git a/contrib/ncurses/progs/toe.c b/contrib/ncurses/progs/toe.c index 6bcff07f53e3..38b85cb362ed 100644 --- a/contrib/ncurses/progs/toe.c +++ b/contrib/ncurses/progs/toe.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -44,7 +44,7 @@ #include <hashed_db.h> #endif -MODULE_ID("$Id: toe.c,v 1.46 2007/10/13 22:26:38 tom Exp $") +MODULE_ID("$Id: toe.c,v 1.48 2008/01/05 20:41:26 tom Exp $") #define isDotname(name) (!strcmp(name, ".") || !strcmp(name, "..")) @@ -316,6 +316,7 @@ main(int argc, char *argv[]) bool direct_dependencies = FALSE; bool invert_dependencies = FALSE; bool header = FALSE; + char *report_file = 0; int i; int code; int this_opt, last_opt = '?'; @@ -323,7 +324,7 @@ main(int argc, char *argv[]) _nc_progname = _nc_rootname(argv[0]); - while ((this_opt = getopt(argc, argv, "0123456789ahuvUV")) != -1) { + while ((this_opt = getopt(argc, argv, "0123456789ahu:vU:V")) != -1) { /* handle optional parameter */ if (isdigit(this_opt)) { switch (last_opt) { @@ -349,12 +350,14 @@ main(int argc, char *argv[]) break; case 'u': direct_dependencies = TRUE; + report_file = optarg; break; case 'v': v_opt = 1; break; case 'U': invert_dependencies = TRUE; + report_file = optarg; break; case 'V': puts(curses_version()); @@ -365,15 +368,15 @@ main(int argc, char *argv[]) } set_trace_level(v_opt); - if (direct_dependencies || invert_dependencies) { - if (freopen(argv[optind], "r", stdin) == 0) { + if (report_file != 0) { + if (freopen(report_file, "r", stdin) == 0) { (void) fflush(stdout); - fprintf(stderr, "%s: can't open %s\n", _nc_progname, argv[optind]); + fprintf(stderr, "%s: can't open %s\n", _nc_progname, report_file); ExitProgram(EXIT_FAILURE); } /* parse entries out of the source file */ - _nc_set_source(argv[optind]); + _nc_set_source(report_file); _nc_read_entry_source(stdin, 0, FALSE, FALSE, NULLHOOK); } |