From: nasm-bot f. C. S. B. <cha...@in...> - 2017-04-25 19:55:57
|
Commit-ID: 64dd380f1e0b9298d086cdbf0ecdbda0756fb557 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=64dd380f1e0b9298d086cdbf0ecdbda0756fb557 Author: Chang S. Bae <cha...@in...> AuthorDate: Mon, 24 Apr 2017 21:03:33 -0700 Committer: H. Peter Anvin <hp...@zy...> CommitDate: Tue, 25 Apr 2017 12:53:52 -0700 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 <cha...@in...> Signed-off-by: H. Peter Anvin <hp...@zy...> --- nasmlib/path.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nasmlib/path.c b/nasmlib/path.c index fd7ea13..0cb9713 100644 --- a/nasmlib/path.c +++ b/nasmlib/path.c @@ -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--; } |