Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: more flexible cd builtin revised
- X-seq: zsh-workers 9065
- From: Clint Adams <schizo@xxxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxxxxxxxxx>
- Subject: PATCH: more flexible cd builtin revised
- Date: Wed, 15 Dec 1999 13:38:00 -0500
- Cc: zsh-workers@xxxxxxxxxxxxxx
- In-reply-to: <991215170926.ZM15212@xxxxxxxxxxxxxxxxxxxxxxx>; from schaefer@xxxxxxxxxxxxxxxxxxxxxxx on Wed, Dec 15, 1999 at 05:09:26PM +0000
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
- References: <19991213165621.A2898@xxxxxxxx> <991215170926.ZM15212@xxxxxxxxxxxxxxxxxxxxxxx>
> if (lchdir(buf, NULL, hard) && lchdir(dest, NULL, hard))
Yes, that makes more sense.
Index: Src/builtin.c
===================================================================
RCS file: /cvs/zsh/zsh/Src/builtin.c,v
retrieving revision 1.1.1.45
diff -u -r1.1.1.45 builtin.c
--- Src/builtin.c 1999/12/13 21:57:56 1.1.1.45
+++ Src/builtin.c 1999/12/15 18:35:49
@@ -951,8 +951,11 @@
else
unmetafy(buf, &dlen);
- if (lchdir(dest, NULL, hard)) /* Try plain relative first */
- if (lchdir(buf, NULL, hard)) {
+ /* We try the full path first. If that fails, try the
+ * argument to cd relatively. This is useful if the cwd
+ * or a parent directory is renamed in the interim.
+ */
+ if (lchdir(buf, NULL, hard) && lchdir(dest, NULL, hard)) {
free(buf);
return NULL;
}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author