sys/unix/*.c formatting and PANICTRACE fix

I started out just reformatting the function header for regularize()
but ended up doing miscellaneous other stuff, including some code
changes.  I think the CHDIR code is a bit cleaner now, but shouldn't
have any differences in behavior.

Along the way I noticed that 'nethack -dpath' or 'nethack -d path'
modifies argv[] before PANICTRACE attempted to save argv[0], so would
break having nethack invoke gdb to get a backtrace.  ('ARGV0' seems to
be unnecessary since 'hname' holds the same value, but I didn't get rid
of it....)
This commit is contained in:
PatR
2017-09-13 15:33:43 -07:00
parent 127f74bb24
commit cd8f028352
6 changed files with 127 additions and 91 deletions

View File

@@ -421,7 +421,7 @@ struct plinemsg_type {
E struct plinemsg_type *plinemsg_types;
#ifdef PANICTRACE
E char *ARGV0;
E const char *ARGV0;
#endif
#undef E