From mboxrd@z Thu Jan 1 00:00:00 1970 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes Date: Wed, 3 Feb 1999 16:52:37 +0100 (MET) Message-Id: <199902031552.QAA13399@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Sven Wischnowsky's message of Wed, 3 Feb 1999 16:00:52 +0100 (MET) Subject: quote modifier for parameter expansion? X-Mailing-List: 5208 I wrote: > People using the new style completion stuff (and the new-completion-examples > find) who test the thing quoted above will notice that it completes > files beginning with `I' in this case. This is due to the parameter > handling in pfiles(). More precisely, this is due to the fact that we > still haven't got a way to quote strings resulting from a parameter > expansion (supporting the `q' modifier for parameter expansion has > long been on the wish list but still isn't implemented). Hm. I'm sure I'm missing something again, but could anyone please tell me what? The patch below (which probably shouldn't be used) just uses the quote()-function from hist.c to make the `q' modifier in parameter expansion work. The result is almost always a funny looking string in single quotes, but that alone can't be the reason not to use this function. Bye Sven --- os/subst.c Wed Feb 3 12:07:13 1999 +++ Src/subst.c Wed Feb 3 16:36:39 1999 @@ -1708,6 +1708,7 @@ case 't': case 'l': case 'u': + case 'q': c = **ptr; break; @@ -1826,6 +1827,9 @@ if (hsubl && hsubr) subst(©, hsubl, hsubr, gbal); break; + case 'q': + quote(©); + break; } tc = *tt; *tt = '\0'; @@ -1876,6 +1880,9 @@ zsfree(oldstr); } } + break; + case 'q': + quote(str); break; } } -- Sven Wischnowsky wischnow@informatik.hu-berlin.de