MCPcopy Create free account
hub / github.com/NetHack/NetHack / dosh

Function dosh

sys/unix/unixunix.c:343–365  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

341
342#ifdef SHELL
343int
344dosh(void)
345{
346 char *str;
347
348#ifdef SYSCF
349 if (!sysopt.shellers || !sysopt.shellers[0]
350 || !check_user_string(sysopt.shellers)) {
351 /* FIXME: should no longer assume a particular command keystroke */
352 Norep("Unavailable command '!'.");
353 return 0;
354 }
355#endif
356 if (child(0)) {
357 if ((str = getenv("SHELL")) != (char *) 0)
358 (void) execl(str, str, (char *) 0);
359 else
360 (void) execl("/bin/sh", "sh", (char *) 0);
361 raw_print("sh: cannot execute.");
362 exit(EXIT_FAILURE);
363 }
364 return 0;
365}
366#endif /* SHELL */
367
368#if defined(SHELL) || defined(DEF_PAGER) || defined(DEF_MAILREADER)

Callers

nothing calls this directly

Calls 4

NorepFunction · 0.85
childFunction · 0.85
raw_printFunction · 0.85
check_user_stringFunction · 0.70

Tested by

no test coverage detected