]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Split a trigraph sequence in a string constant.
authorSimon Tatham <anakin@pobox.com>
Fri, 1 Nov 2002 12:52:51 +0000 (12:52 +0000)
committerSimon Tatham <anakin@pobox.com>
Fri, 1 Nov 2002 12:52:51 +0000 (12:52 +0000)
[originally from svn r2166]

telnet.c

index 18c7d0e46cb77d1f6690ccf37fd95197138aaa57..f20488e3428ea1b9bd73ff35a6230394c6cdf170 100644 (file)
--- a/telnet.c
+++ b/telnet.c
@@ -226,9 +226,14 @@ static void c_write1(Telnet telnet, int c)
 static void log_option(Telnet telnet, char *sender, int cmd, int option)
 {
     char buf[50];
+    /*
+     * The strange-looking "<?""?>" below is there to avoid a
+     * trigraph - a double question mark followed by > maps to a
+     * closing brace character!
+     */
     sprintf(buf, "%s:\t%s %s", sender,
            (cmd == WILL ? "WILL" : cmd == WONT ? "WONT" :
-            cmd == DO ? "DO" : cmd == DONT ? "DONT" : "<??>"),
+            cmd == DO ? "DO" : cmd == DONT ? "DONT" : "<?""?>"),
            telopt(option));
     logevent(telnet->frontend, buf);
 }