X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/4a78cbcd4fa986d9c1e7bd0a5a4bdb619faeb7cb..f93ce652c5d1361b00a28db7bbb9e638197a6676:/uip/prompter.c?ds=sidebyside diff --git a/uip/prompter.c b/uip/prompter.c index 0aedc8c1..37f5960b 100644 --- a/uip/prompter.c +++ b/uip/prompter.c @@ -78,13 +78,7 @@ main (int argc, char **argv) char *tmpfil; m_getfld_state_t gstate = 0; -#ifdef LOCALE - setlocale(LC_ALL, ""); -#endif - invo_name = r1bindex (argv[0], '/'); - - /* read user profile/context */ - context_read(); + if (nmh_init(argv[0], 1)) { return 1; } arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; @@ -233,7 +227,7 @@ abort: if (killp || erasep) { tcsetattr(0, TCSADRAIN, &tio); } - unlink (tmpfil); + (void) m_unlink (tmpfil); done (1); } if (i != 0 || (field[0] != '\n' && field[0] != 0)) { @@ -322,7 +316,7 @@ abort: cpydata (fdi, fdo, tmpfil, drft); close (fdi); close (fdo); - unlink (tmpfil); + (void) m_unlink (tmpfil); context_save (); /* save the context file */ done (0);