mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-01-24 16:35:40 +08:00
nasmlib: include macro for Mach system and fix on filename extraction
Add __MACH__ as a Unix-like system (e.g. MacOS X defines __MACH__ but no variant of __unix__.) Fix a reversed test in first_filename_char(). Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
parent
c6bbfaa70d
commit
64dd380f1e
@ -39,7 +39,7 @@
|
||||
#include "nasmlib.h"
|
||||
#include "error.h"
|
||||
|
||||
#if defined(unix) || defined(__unix) || defined(__unix__)
|
||||
#if defined(unix) || defined(__unix) || defined(__unix__) || defined(__MACH__)
|
||||
# define separators "/"
|
||||
# define cleandirend "/"
|
||||
# define catsep '/'
|
||||
@ -93,7 +93,7 @@ static const char *first_filename_char(const char *path)
|
||||
const char *p = path + strlen(path);
|
||||
|
||||
while (p > path) {
|
||||
if (!ismatch(separators, p[-1]))
|
||||
if (ismatch(separators, p[-1]))
|
||||
return p;
|
||||
p--;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user