#include "common/options.hpp"
#include "common/checks.hpp"
+#include "p9y/libgen.hpp"
+#include "p9y/realpath.hpp"
#include <cerrno>
#include <climits>
#include <cstdlib>
-#include <libgen.h>
#include <fstream>
#include <sstream>
+#ifndef PATH_MAX
+# ifdef MAX_PATH
+# define PATH_MAX MAX_PATH
+# else
+# define PATH_MAX 256
+# endif
+#endif
+
struct memcp_file {
enum class type {
basename,
} else if (file.key == memcp_file::type::relative) {
*path = file.path;
} else {
- *path = basename((file.path));
+ *path = basename(file.path);
}
return true;
}