diff --git a/configure.ac b/configure.ac index e67595c5d..2df950807 100644 --- a/configure.ac +++ b/configure.ac @@ -320,45 +320,6 @@ fi # features that Autoconf doesn't tell us about # - -# -# Check if realpath accepts null for its second argument -# - -AC_MSG_CHECKING([if realpath accepts null for its second argument]) -AC_RUN_IFELSE( - [ - AC_LANG_PROGRAM( - [ - #include - #include - #include - ], - [ - int status; - char *res; - res = realpath( "somefile", 0 ); - status = !(res != 0 || errno == ENOENT); - exit( status ); - ] - ) - ], - [have_realpath_null=yes], - [have_realpath_null=no] -) - -if test "$have_realpath_null" = yes; then - AC_MSG_RESULT(yes) - AC_DEFINE( - [HAVE_REALPATH_NULL], - [1], - [Define to 1 if realpath accepts null for its second argument.] - ) -else - AC_MSG_RESULT(no) -fi - - # # Check if struct winsize and TIOCGWINSZ exist # diff --git a/src/wutil.cpp b/src/wutil.cpp index 27bd0c508..24069b398 100644 --- a/src/wutil.cpp +++ b/src/wutil.cpp @@ -332,8 +332,6 @@ void safe_perror(const char *message) { errno = err; } -#ifdef HAVE_REALPATH_NULL - wchar_t *wrealpath(const wcstring &pathname, wchar_t *resolved_path) { if (pathname.size() == 0) return NULL; @@ -389,28 +387,6 @@ wchar_t *wrealpath(const wcstring &pathname, wchar_t *resolved_path) { return wcsdup(wreal_path.c_str()); } -#else - -wchar_t *wrealpath(const wcstring &pathname, wchar_t *resolved_path) { - cstring tmp = wcs2string(pathname); - char narrow_buff[PATH_MAX]; - char *narrow_res = realpath(tmp.c_str(), narrow_buff); - wchar_t *res; - - if (!narrow_res) return 0; - - const wcstring wide_res = str2wcstring(narrow_res); - if (resolved_path) { - wcslcpy(resolved_path, wide_res.c_str(), PATH_MAX); - res = resolved_path; - } else { - res = wcsdup(wide_res.c_str()); - } - return res; -} - -#endif - wcstring wdirname(const wcstring &path) { char *tmp = wcs2str(path.c_str()); char *narrow_res = dirname(tmp);