summaryrefslogtreecommitdiffstats
path: root/usr.sbin/tzsetup/tzsetup.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/tzsetup/tzsetup.c')
-rw-r--r--usr.sbin/tzsetup/tzsetup.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/usr.sbin/tzsetup/tzsetup.c b/usr.sbin/tzsetup/tzsetup.c
index 42522b6..70b91a5 100644
--- a/usr.sbin/tzsetup/tzsetup.c
+++ b/usr.sbin/tzsetup/tzsetup.c
@@ -34,7 +34,7 @@
#ifndef lint
static const char rcsid[] =
- "$Id: tzsetup.c,v 1.10 1998/01/10 15:55:11 steve Exp $";
+ "$Id: tzsetup.c,v 1.11 1998/12/16 05:34:49 peter Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -644,7 +644,7 @@ main(int argc, char **argv)
}
}
- if (optind != argc)
+ if (argc - optind > 1)
usage();
read_iso3166_table();
@@ -668,8 +668,21 @@ main(int argc, char **argv)
}
}
dialog_clear_norefresh();
+ if (optind == argc - 1) {
+ char *msg;
+ asprintf(&msg, "\nUse the default `%s' zone?", argv[optind]);
+ if (!dialog_yesno("Default timezone provided", msg, 7, 72)) {
+ install_zone_file(argv[optind]);
+ dialog_clear();
+ end_dialog();
+ return 0;
+ }
+ free(msg);
+ dialog_clear_norefresh();
+ }
dialog_menu("Time Zone Selector", "Select a region", -1, -1,
NCONTINENTS, -NCONTINENTS, continents, 0, NULL, NULL);
+
dialog_clear();
end_dialog();
return 0;
OpenPOWER on IntegriCloud