diff options
author | prspkt <prspkt@protonmail.com> | 2019-02-19 11:42:13 +0200 |
---|---|---|
committer | prspkt <prspkt@protonmail.com> | 2019-02-19 22:54:05 +0200 |
commit | 8deb82efbf9761378938e1da28fa15920f21b2ca (patch) | |
tree | 5db2690981b6ba4ccdebca961e158c477f970439 /testing/i3wm-gaps/i3wm-musl-glob-tilde.patch | |
parent | 08aa0ef4000ceedfb3e06395396a3eeaf39f52a3 (diff) | |
download | aports-8deb82efbf9761378938e1da28fa15920f21b2ca.tar.bz2 aports-8deb82efbf9761378938e1da28fa15920f21b2ca.tar.xz |
testing/i3wm-gaps: upgrade to 4.16.1
Diffstat (limited to 'testing/i3wm-gaps/i3wm-musl-glob-tilde.patch')
-rw-r--r-- | testing/i3wm-gaps/i3wm-musl-glob-tilde.patch | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/testing/i3wm-gaps/i3wm-musl-glob-tilde.patch b/testing/i3wm-gaps/i3wm-musl-glob-tilde.patch index 82ad6195b8..d4f9113e6b 100644 --- a/testing/i3wm-gaps/i3wm-musl-glob-tilde.patch +++ b/testing/i3wm-gaps/i3wm-musl-glob-tilde.patch @@ -1,10 +1,9 @@ -diff -urp i3-4.11/i3bar/src/main.c i3-4.11.new/i3bar/src/main.c ---- i3-4.11/i3bar/src/main.c 2015-09-30 07:55:10.000000000 +0100 -+++ i3-4.11.new/i3bar/src/main.c 2016-02-08 20:03:41.777392482 +0000 -@@ -45,14 +45,20 @@ void debuglog(char *fmt, ...) { +--- a/i3bar/src/main.c ++++ b/i3bar/src/main.c +@@ -48,14 +48,20 @@ void debuglog(char *fmt, ...) { * */ - char *expand_path(char *path) { + static char *expand_path(char *path) { - static glob_t globbuf; - if (glob(path, GLOB_NOCHECK | GLOB_TILDE, NULL, &globbuf) < 0) { - ELOG("glob() failed\n"); @@ -27,19 +26,18 @@ diff -urp i3-4.11/i3bar/src/main.c i3-4.11.new/i3bar/src/main.c + + return sstrdup(path); } - + void print_usage(char *elf_name) { -diff -urp i3-4.11/libi3/resolve_tilde.c i3-4.11.new/libi3/resolve_tilde.c ---- i3-4.11/libi3/resolve_tilde.c 2015-09-30 07:55:10.000000000 +0100 -+++ i3-4.11.new/libi3/resolve_tilde.c 2016-02-08 20:03:47.849230953 +0000 -@@ -19,27 +19,18 @@ +--- a/libi3/resolve_tilde.c ++++ b/libi3/resolve_tilde.c +@@ -19,28 +19,18 @@ * */ char *resolve_tilde(const char *path) { - static glob_t globbuf; - char *head, *tail, *result; + char *home, *expanded; - + - tail = strchr(path, '/'); - head = sstrndup(path, tail ? (size_t)(tail - path) : strlen(path)); - @@ -53,9 +51,9 @@ diff -urp i3-4.11/libi3/resolve_tilde.c i3-4.11.new/libi3/resolve_tilde.c - } else { - head = globbuf.gl_pathv[0]; - result = scalloc(strlen(head) + (tail ? strlen(tail) : 0) + 1, 1); -- strncpy(result, head, strlen(head)); -- if (tail) -- strncat(result, tail, strlen(tail)); +- strcpy(result, head); +- if (tail) { +- strcat(result, tail); + if (strncmp(path, "~/", 2) == 0) { + home = getenv("HOME"); + if (home != NULL) { @@ -64,10 +62,10 @@ diff -urp i3-4.11/libi3/resolve_tilde.c i3-4.11.new/libi3/resolve_tilde.c + strcpy(expanded, home); + strcat(expanded, path+1); + return expanded; -+ } + } } - globfree(&globbuf); - + - return result; + return sstrdup(path); } |