Fix usage of relative paths in -d argument.

$ ./ptest-runner -d ./tests/data

Signed-off-by: Aníbal Limón <anibal.li...@linaro.org>
---
 main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/main.c b/main.c
index 505829c..593aff1 100644
--- a/main.c
+++ b/main.c
@@ -19,6 +19,7 @@
  *     Aníbal Limón <anibal.li...@intel.com>
  */
 
+#include <limits.h>
 #include <unistd.h>
 #include <string.h>
 #include <stdlib.h>
@@ -70,7 +71,7 @@ main(int argc, char *argv[])
                switch (opt) {
                        case 'd':
                                free(opts.directory);
-                               opts.directory = strdup(optarg);
+                               opts.directory = realpath(optarg, NULL);
                                CHECK_ALLOCATION(opts.directory, 1, 1);
                        break;
                        case 'l':
-- 
2.11.0

-- 
_______________________________________________
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto

Reply via email to