This is optional behaviour that may not be wanted. To disable, pass -DAPOUT_DONT_ASSUME_ROOT in the CFLAGS. (Also changed timestamp format because it does not include the time zone. Using plain %c now.)
/* Startup for apout. Parse arguments, load the binary, and run it.
*
- * $Revision: 1.22 $
- * $Date: 2002/06/10 11:44:21 $
+ * $Revision: 1.23 $
+ * $Date: Mon 31 Oct 2016 03:46:15 AM CET $
*/
#include <assert.h>
#include "defines.h"
if ((apout_root = getenv("APOUT_ROOT"))) {
set_apout_root(apout_root);
} else {
+#ifdef APOUT_DONT_ASSUME_ROOT
fprintf(stderr,
"APOUT_ROOT env variable not set before running apout\n");
exit(1);
- }
+#else
+ set_apout_root("/");
+#endif
+ }
/* Try to load the binary as an a.out */
if (load_a_out(argv[0],NULL,1) == -1) {