Merge branch 'NetHack-3.6'

This commit is contained in:
nhmall
2019-07-13 00:38:10 -04:00
27 changed files with 123 additions and 89 deletions

View File

@@ -572,4 +572,21 @@ VA_DECL(const char *, str)
#endif
}
/* nhassert_failed is called when an nhassert's condition is false */
void
nhassert_failed(filepath, line)
const char * filepath;
int line;
{
const char * filename;
/* attempt to get filename from path. TODO: we really need a port provided
* function to return a filename from a path */
filename = strrchr(filepath, '/');
filename = (filename == NULL ? strrchr(filepath, '\\') : filename);
filename = (filename == NULL ? filepath : filename + 1);
impossible("nhassert failed in file '%s' at line %d", filename, line);
}
/*pline.c*/