summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2015-11-28 12:59:10 +0100
committerDave Davenport <qball@gmpclient.org>2015-11-28 12:59:10 +0100
commitca6b1a8178430e871d16a831d78db2256604054c (patch)
tree06a76c6c66a136fd602dd4ff1db5b520acb188c2
parentbf60d9c01c9eb04b9b9ab825a77e2eebdeb905c2 (diff)
Fixing path.
-rw-r--r--source/helper.c7
-rwxr-xr-xtest/run_script_test.sh1
2 files changed, 8 insertions, 0 deletions
diff --git a/source/helper.c b/source/helper.c
index 5a09f41e..2b99a1c0 100644
--- a/source/helper.c
+++ b/source/helper.c
@@ -680,6 +680,13 @@ char *rofi_expand_path ( const char *input )
str[i] = g_strdup ( p->pw_dir );
}
}
+ else if ( i == 0 ) {
+ char * s = str[i];
+ if ( input[0] == G_DIR_SEPARATOR ) {
+ str[i] = g_strdup_printf ( "%s%s", G_DIR_SEPARATOR_S, s );
+ g_free ( s );
+ }
+ }
}
char *retv = g_build_filenamev ( str );
g_strfreev ( str );
diff --git a/test/run_script_test.sh b/test/run_script_test.sh
index 1279e30c..dc8fa4d4 100755
--- a/test/run_script_test.sh
+++ b/test/run_script_test.sh
@@ -18,6 +18,7 @@ xdotool key Return
wait ${RPID}
RETV=$?
OUTPUT=$(cat output.txt | tr '\n' ' ')
+echo ${OUTPUT}
if [ "${OUTPUT}" != 'noot ' ]
then
exit 1