* output from ctrl-z not demetafyed (i think)
@ 2006-02-07 16:11 Mikael Magnusson
2006-02-07 16:37 ` Peter Stephenson
0 siblings, 1 reply; 2+ messages in thread
From: Mikael Magnusson @ 2006-02-07 16:11 UTC (permalink / raw)
To: zsh-workers
i ran ./pangocairo-view =(echo しはち) to try out the pango examples, and
it works fine. But when i press ctrl-z i get this output,
zsh: suspended ./pangocairo-view =(echo ぃ・はち)
This is similar to what tail .history gives which is:
./pangocairo-view =(echo ぃ・はち)
(i've asked about that before and strings should be metafyed in the
history from what i was told).
i also get this when i run jobs,
[1] + suspended ./pangocairo-view =(echo ぃ・はち)
--
Mikael Magnusson
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: output from ctrl-z not demetafyed (i think)
2006-02-07 16:11 output from ctrl-z not demetafyed (i think) Mikael Magnusson
@ 2006-02-07 16:37 ` Peter Stephenson
0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 2006-02-07 16:37 UTC (permalink / raw)
To: zsh-workers
Yes, it looks like you're right, jobs.c isn't very good with
unmetafication. This fixes it for descriptions in a couple of places.
There may be others but it's not entirely clear; for example, I think
error messages for job names work OK because the error function handles
it properly.
Index: Src/jobs.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/jobs.c,v
retrieving revision 1.42
diff -u -r1.42 jobs.c
--- Src/jobs.c 13 Oct 2005 17:50:00 -0000 1.42
+++ Src/jobs.c 7 Feb 2006 16:33:27 -0000
@@ -556,10 +556,18 @@
#ifdef HAVE_GETRUSAGE
double total_time;
#endif
- int percent;
+ int percent, desclen;
if (!desc)
+ {
desc = "";
+ desclen = 0;
+ }
+ else
+ {
+ desc = dupstring(desc);
+ unmetafy(desc, &desclen);
+ }
/* go ahead and compute these, since almost every TIMEFMT will have them */
elapsed_time = real->tv_sec + real->tv_usec / 1000000.0;
@@ -706,7 +714,7 @@
break;
#endif
case 'J':
- fprintf(stderr, "%s", desc);
+ fwrite(desc, sizeof(char), desclen, stderr);
break;
case '%':
putc('%', stderr);
@@ -914,8 +922,14 @@
(int)(len - 14 + 2 - strlen(sigmsg(WTERMSIG(pn->status)))), "");
else
fprintf(fout, "%-*s", len + 2, sigmsg(WTERMSIG(pn->status)));
- for (; pn != qn; pn = pn->next)
- fprintf(fout, (pn->next) ? "%s | " : "%s", pn->text);
+ for (; pn != qn; pn = pn->next) {
+ char *txt = dupstring(pn->text);
+ int txtlen;
+ unmetafy(txt, &txtlen);
+ fwrite(txt, sizeof(char), txtlen, fout);
+ if (pn->next)
+ fputs(" | ", fout);
+ }
putc('\n', fout);
fline = 0;
}
--
Peter Stephenson <pws@csr.com> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-02-07 16:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-07 16:11 output from ctrl-z not demetafyed (i think) Mikael Magnusson
2006-02-07 16:37 ` Peter Stephenson
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).