Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Rewrite of compsys.yo
- X-seq: zsh-workers 18465
- From: Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx (Zsh hackers list)
- Subject: Re: Rewrite of compsys.yo
- Date: Wed, 23 Apr 2003 18:25:17 +0100
- In-reply-to: "Oliver Kiddle"'s message of "Fri, 18 Apr 2003 15:17:00 +0200." <6750.1050671820@xxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
Oliver Kiddle wrote:
> For _arguments, there seems to now be no documentation for the option
> descriptions that appear in square brackets.
Do you mean something other than this chunk?
item(var(optspec)tt([)var(explanation)tt(]))(
An explanation string may be appended to any of the preceding forms of
var(optspec) by enclosing it in brackets, as in `tt(-q[query operation])'.
The tt(verbose) style is used to decide whether the explanation strings
are displayed with the option in a completion listing.
If no bracketed explanation string is given but the tt(auto-description)
style is set and only one argument is described for this var(optspec), the
value of the style is displayed, with any appearance of the sequence
`tt(%d)' in it replaced by the var(message) of the first var(optarg)
that follows the var(optspec); see below.
)
> The old documentation also seemed to be implying that setting $context,
> $line and $opt_args was dependant on using -R.
It did indeed, I just copied that.
> Also,
> someone has recently posted about a bug with pwd and metafy() to the
> sourceforge tracker which probably needs looking at.
The fix looks all right and I've just committed it to both branches:
*Submitted By:* IKEGAMI, Tsutomu (ikegami)
*Date Submitted:* 2003-04-16 09:18
Symptom:
I'm using zsh on Mac OS X, where filenames are encoded with UTF-8.
There, pwd builtin command gives a wrong answer if:
1) used inside of a shell-script,
2) there's no preceding cd command,
3) chase_links option is off,
4) and the script is launched from a 'Kanji' directory.
The 'Kanji' directory means that some characters outside of ASCII set
(0x20-0x7f) are contained in the path.
Origin:
Pwd command uses internal variable char *pwd for its answer. *Pwd
is initialized in init.c, where PWD environment variable is refered.
PWD environment variable may contain META characters under UTF-8
encoding, but it is used without metafy().
Solution:
--- Src/init.c.org Wed Apr 16 17:26:33 2003
+++ Src/init.c Wed Apr 16 17:51:29 2003
@@ -753,7 +753,8 @@
* initialize `PWD' from `HOME' */
if (ispwd(home))
pwd = ztrdup(home);
- else if ((ptr = zgetenv("PWD")) && ispwd(ptr))
+ else if ( (ptr = zgetenv("PWD")) && (strlen(ptr) < PATH_MAX) &&
+ (ptr = metafy(ptr, -1, META_STATIC), ispwd(ptr)) )
pwd = ztrdup(ptr);
else
pwd = metafy(zgetcwd(), -1, META_DUP);
--
Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxx>
Work: pws@xxxxxxx
Web: http://www.pwstephenson.fsnet.co.uk
Messages sorted by:
Reverse Date,
Date,
Thread,
Author