set_debugfs_path();
status = p->fn(argc, argv, prefix);
+ exit_browser(status);
+
if (status)
return status & 0xff;
- exit_browser();
-
/* Somebody closed stdout? */
if (fstat(fileno(stdout), &st))
return 0;
{
setup_pager();
}
-static inline void exit_browser(void) {}
+static inline void exit_browser(bool wait_for_ok __used) {}
#else
void setup_browser(void);
-void exit_browser(void);
+void exit_browser(bool wait_for_ok);
#endif
extern const char *editor_program;
newtFormDestroy(form);
}
+static char browser__last_msg[1024];
+
int browser__show_help(const char *format, va_list ap)
{
int ret;
static int backlog;
- static char msg[1024];
- ret = vsnprintf(msg + backlog, sizeof(msg) - backlog, format, ap);
+ ret = vsnprintf(browser__last_msg + backlog,
+ sizeof(browser__last_msg) - backlog, format, ap);
backlog += ret;
- if (msg[backlog - 1] == '\n') {
+ if (browser__last_msg[backlog - 1] == '\n') {
newtPopHelpLine();
- newtPushHelpLine(msg);
+ newtPushHelpLine(browser__last_msg);
newtRefresh();
backlog = 0;
}
newtPushHelpLine(" ");
}
-void exit_browser(void)
+void exit_browser(bool wait_for_ok)
{
- if (use_browser)
+ if (use_browser) {
+ if (wait_for_ok) {
+ char title[] = "Fatal Error", ok[] = "Ok";
+ newtWinMessage(title, ok, browser__last_msg);
+ }
newtFinished();
+ }
}