[dev] [PATCH 2/2] find: Use the symlink itself for broken symlinks

2018-11-01 Thread tavianator
From: Tavian Barnes About -H/-L, POSIX says > If the referenced file does not exist, the file information and type > shall be for the link itself. so we need to fall back from stat() to lstat() if errno indicates a broken link. --- find.c | 17 +++-- 1 file changed, 15 insertions(+

[dev] [PATCH 1/2] find: "-" by itself is a file name

2018-11-01 Thread tavianator
From: Tavian Barnes See https://savannah.gnu.org/bugs/?15235 for a discussion of why the POSIX wording implies that "-" by itself is not part of the expression. --- find.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/find.c b/find.c index 03889a8..f96c05b 100644 ---

Re: [dev] [st][PATCH] better plumbing on linux: find child shell cwd without shell gymnastics

2018-11-01 Thread Jérôme Andrieux
> So, which option sucks least? TLDR: OSC7 from the shell, IMO. Given that I use st/zsh on OpenBSD more than Linux and wanted to add some 9term/rc mouse features to its glory, I tried quite a few tricks to get the current shell cwd. I decided on using the OSC7 approach, ie push from the shell to

Re: [dev] [st][PATCH] better plumbing on linux: find child shell cwd without shell gymnastics

2018-11-01 Thread Markus Wichmann
On Thu, Nov 01, 2018 at 04:12:40PM +0100, John Soros wrote: > Yes! This is much, much better! Thanks. Pity that it still doesn't work > on OpenBSD. If the info I gathered over the course of the last hour is correct, then the way to query CWD in OpenBSD is #include char cwd[PATH_MAX];

Re: [dev] [st][PATCH] better plumbing on linux: find child shell cwd without shell gymnastics

2018-11-01 Thread John Soros
On 01/11/2018 15:04, John Soros wrote: > On 01/11/2018 13:43, Markus Wichmann wrote: >> On Thu, Nov 01, 2018 at 08:46:06AM +0100, John Soros wrote: >>> config.def.h | 6 + >>> x.c | 76 >>> 2 files changed, 82 insertions(+) >>> >>>

Re: [dev] [st][PATCH] better plumbing on linux: find child shell cwd without shell gymnastics

2018-11-01 Thread John Soros
On 01/11/2018 13:43, Markus Wichmann wrote: > On Thu, Nov 01, 2018 at 08:46:06AM +0100, John Soros wrote: >> config.def.h | 6 + >> x.c | 76 >> 2 files changed, 82 insertions(+) >> >> diff --git a/config.def.h b/config.def.h >> in

Re: [dev] [st][PATCH] better plumbing on linux: find child shell cwd without shell gymnastics

2018-11-01 Thread Markus Wichmann
On Thu, Nov 01, 2018 at 09:33:37AM +0100, Quentin Rameau wrote: > Hello John, > > > + DIR* srcdir = opendir("/proc/self/task"); > > Is that a Linux‐only patch? > The subject line would indicate thus. Funnily enough, *that* dependency could be removed. What can't be removed is the dependency o

Re: [dev] [st][PATCH] better plumbing on linux: find child shell cwd without shell gymnastics

2018-11-01 Thread Markus Wichmann
On Thu, Nov 01, 2018 at 08:46:06AM +0100, John Soros wrote: > config.def.h | 6 + > x.c | 76 > 2 files changed, 82 insertions(+) > > diff --git a/config.def.h b/config.def.h > index 87ebdbb..265a4ff 100644 > --- a/config.def.h >

Re: [dev] [st][PATCH] better plumbing on linux: find child shell cwd without shell gymnastics

2018-11-01 Thread Quentin Rameau
Hello John, > + DIR* srcdir = opendir("/proc/self/task"); Is that a Linux‐only patch?

[dev] [st][PATCH] better plumbing on linux: find child shell cwd without shell gymnastics

2018-11-01 Thread John Soros
config.def.h | 6 + x.c | 76 2 files changed, 82 insertions(+) diff --git a/config.def.h b/config.def.h index 87ebdbb..265a4ff 100644 --- a/config.def.h +++ b/config.def.h @@ -467,3 +467,9 @@ static char ascii_printable[] =