yanglint BUGFIX cwd in interactive mode
diff --git a/CMakeModules/UseCompat.cmake b/CMakeModules/UseCompat.cmake
index 34a9741..ef3df89 100644
--- a/CMakeModules/UseCompat.cmake
+++ b/CMakeModules/UseCompat.cmake
@@ -54,7 +54,6 @@
check_function_exists(timegm HAVE_TIMEGM)
check_symbol_exists(strptime "time.h" HAVE_STRPTIME)
check_symbol_exists(mmap "sys/mman.h" HAVE_MMAP)
- check_symbol_exists(dirname "libgen.h" HAVE_DIRNAME)
check_symbol_exists(setenv "stdlib.h" HAVE_SETENV)
unset(CMAKE_REQUIRED_DEFINITIONS)
diff --git a/compat/compat.c b/compat/compat.c
index 5fb2be8..7bc86b3 100644
--- a/compat/compat.c
+++ b/compat/compat.c
@@ -322,21 +322,6 @@
#endif
#endif
-#ifndef HAVE_DIRNAME
-#ifdef _WIN32
-#include <shlwapi.h>
-char *
-dirname(char *path)
-{
- PathRemoveFileSpecA(path);
- return path;
-}
-
-#else
-#error No dirname() implementation for this platform is available.
-#endif
-#endif
-
#ifndef HAVE_SETENV
#ifdef _WIN32
int
diff --git a/compat/compat.h.in b/compat/compat.h.in
index 0fa2fe7..3baa489 100644
--- a/compat/compat.h.in
+++ b/compat/compat.h.in
@@ -71,7 +71,6 @@
#cmakedefine HAVE_TIMEGM
#cmakedefine HAVE_STRPTIME
#cmakedefine HAVE_MMAP
-#cmakedefine HAVE_DIRNAME
#cmakedefine HAVE_STRCASECMP
#cmakedefine HAVE_SETENV
diff --git a/tools/lint/cmd_add.c b/tools/lint/cmd_add.c
index eb58745..38663c2 100644
--- a/tools/lint/cmd_add.c
+++ b/tools/lint/cmd_add.c
@@ -18,7 +18,6 @@
#include "cmd.h"
#include <getopt.h>
-#include <libgen.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
@@ -135,7 +134,7 @@
}
/* add temporarily also the path of the module itself */
- if (ly_ctx_set_searchdir(*ctx, dirname(dir)) == LY_EEXIST) {
+ if (ly_ctx_set_searchdir(*ctx, dir) == LY_EEXIST) {
path_unset = 0;
}