]> git.mdlowis.com Git - projs/tide.git/commitdiff
moved ./ stripping logic into buf_load
authorMichael D. Lowis <mike@mdlowis.com>
Sat, 3 Dec 2016 15:23:43 +0000 (10:23 -0500)
committerMichael D. Lowis <mike@mdlowis.com>
Sat, 3 Dec 2016 15:23:43 +0000 (10:23 -0500)
libedit/buf.c
xfilepick

index 528928123617203d9e05fb26f2efcaec5fdaae97..f2f5e17840e1290e75c9de0cf62c1b0daad235aa 100644 (file)
@@ -4,6 +4,8 @@
 #include <ctype.h>
 
 unsigned buf_load(Buf* buf, char* path) {
+    if (path && path[0] == '.' && path[1] == '/')
+        path += 2;
     unsigned off = 0;
     buf->path = stringdup(path);
     char* addr = strrchr(buf->path, ':');
index 503b9e05eb19d9cb7c667bc1545c890f7e342bd9..360a383543d1c38c09829e74c09f4dac4e410952 100755 (executable)
--- a/xfilepick
+++ b/xfilepick
@@ -3,4 +3,5 @@ if [ "$#" -ne 1 ]; then
     echo "Usage: $0 <dir>"
     exit 1
 fi
-find $1 -not -path '*/\.*' -type f | xpick
+
+find $1 -not -path '*/\.*' -type f | sed "s|^\./||" | xpick