From 48e405f702ba03b841730fb38675de060cdc7d4e Mon Sep 17 00:00:00 2001 From: Gustavo Sverzut Barbieri Date: Wed, 4 Jul 2012 18:45:23 +0000 Subject: [PATCH] actually we should not realpath() the input. directories may show with incorrect names if they were links. SVN revision: 73297 --- src/bin/e_fm_cmdline.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/src/bin/e_fm_cmdline.c b/src/bin/e_fm_cmdline.c index 8a1126b..4c67efe 100644 --- a/src/bin/e_fm_cmdline.c +++ b/src/bin/e_fm_cmdline.c @@ -6,6 +6,7 @@ #include #include #include +#include static E_DBus_Connection *conn = NULL; static int retval = EXIT_SUCCESS; @@ -36,12 +37,35 @@ fm_open(const char *path) { DBusMessage *msg; Eina_Bool sent; - char *p = ecore_file_realpath(path); + char *p; + + if (path[0] == '/') + p = strdup(path); + else + { + char buf[PATH_MAX]; + if (!getcwd(buf, sizeof(buf))) + { + fprintf(stderr, + "ERROR: Could not get current working directory: %s\n", + strerror(errno)); + ecore_idler_add(fm_error_quit_last, NULL); + return; + } + if (strcmp(path, ".") == 0) + p = strdup(buf); + else + { + char tmp[PATH_MAX]; + snprintf(tmp, sizeof(tmp), "%s/%s", buf, path); + p = strdup(tmp); + } + } EINA_LOG_DBG("'%s' -> '%s'", path, p); if ((!p) || (p[0] == '\0')) { - fprintf(stderr, "ERROR: Could not get real path '%s'\n", path); + fprintf(stderr, "ERROR: Could not get path '%s'\n", path); ecore_idler_add(fm_error_quit_last, NULL); free(p); return; -- 2.7.4