X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Fbin%2Fmemcp.cc;h=7396057e930f8269a5812db9ce72aec7a4e8f439;hb=2902291b9589d17e55d2397959c8cff9772b38a3;hp=eb7151e65a8680155b565cd1a8870cae48e84792;hpb=6e77392804b33fec81b9d6d3fc3fd65c4b879ce1;p=awesomized%2Flibmemcached diff --git a/src/bin/memcp.cc b/src/bin/memcp.cc index eb7151e6..7396057e 100644 --- a/src/bin/memcp.cc +++ b/src/bin/memcp.cc @@ -21,14 +21,23 @@ #include "common/options.hpp" #include "common/checks.hpp" +#include "p9y/libgen.hpp" +#include "p9y/realpath.hpp" #include #include #include -#include #include #include +#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, @@ -130,7 +139,7 @@ static bool path2key(const client_options &opt, memcp_file &file, char **path) { } else if (file.key == memcp_file::type::relative) { *path = file.path; } else { - *path = basename((file.path)); + *path = basename(file.path); } return true; }