- int argc;
- char *argv[];
-
-{
-
- int use_menu = 1;
- char buf[BUFSIZ];
-
- init_sms_err_tbl();
- init_krb_err_tbl();
-
- if (getenv("TERM") == (char *) NULL) {
- printf("Please set your TERM environment variable\n");
- goto punt;
- }
- if (getenv("TERMCAP") == (char *) NULL) {
- printf("Please set your TERMCAP environment variable\n");
- goto punt;
- }
- if ((whoami = rindex(argv[0], '/')) == NULL)
- whoami = argv[0];
- else
- whoami++;
- uname = (char *) calloc(20, 1);
- if ((current_li = (List_info *) malloc(sizeof(List_info)))
- == (List_info *) NULL) {
- (void) sprintf(buf, ": allocating list info");
- goto punt;
- } else {
- current_li->acl = (char *) NULL;
- current_li->desc = (char *) NULL;
- current_li->expdate = (char *) NULL;
- }
- if ((uname = getlogin()) == NULL) {
- struct passwd *getpwuid();
- uname = getpwuid(getuid())->pw_name;
- }
- uname = (uname && strlen(uname))? ds(uname): "";
+ int argc;
+ char *argv[];
+
+{
+
+ int use_menu = 1;
+ char buf[BUFSIZ];
+ extern void sms_com_err_hook();
+
+ init_sms_err_tbl();
+ init_krb_err_tbl();
+ set_com_err_hook(sms_com_err_hook);
+
+ /*
+ * This shouldn't be here.... the experienced user will catch the error
+ * -- the inexperienced one will just be confused.
+ *
+ * if (getenv("TERM") == (char *) NULL) { Put_message("Please set your TERM
+ * environment variable\n"); goto punt; } if (getenv("TERMCAP") == (char
+ * *) NULL) { Put_message("Please set your TERMCAP environment
+ * variable\n"); goto punt; }
+ *
+ */
+ if ((whoami = rindex(argv[0], '/')) == NULL)
+ whoami = argv[0];
+ else
+ whoami++;
+ uname = calloc(20, 1);
+ if ((current_li = (List_info *) malloc(sizeof(List_info)))
+ == (List_info *) NULL) {
+ (void) sprintf(buf, ": allocating list info");
+ goto punt;
+ }
+ else {
+ current_li->acl = (char *) NULL;
+ current_li->desc = (char *) NULL;
+ current_li->expdate = (char *) NULL;
+ }
+ if ((uname = getlogin()) == NULL) {
+ struct passwd *getpwuid();