Thread (5 messages) flat view 5 messages, 5 authors, 2016-06-15

Re: [RFC] sending errors to stdout under $PAGER

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:44:14

Hi,

On Sun, 17 Feb 2008, Edgar Toernig wrote:
Junio C Hamano wrote:
quoted
+	FILE *outto = (pager_in_use() ? stdout : stderr);
+
 	vsnprintf(msg, sizeof(msg), err, params);
-	fprintf(stderr, "%s%s\n", prefix, msg);
+	fprintf(outto, "%s%s\n", prefix, msg);

What do people think?  Have I overlooked any downsides?
Wouldn't it be better/safer to redirect stderr to the pager
in the first place?

[...]

         /* return in the child */
        if (!pid) {
                dup2(fd[1], 1);
+               dup2(fd[1], 2);
                close(fd[0]);
                close(fd[1]);
                return;
        }
I like it.

Ciao,
Dscho
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help