Rainer Orth <r...@cebitec.uni-bielefeld.de> writes:

>> Is tIOC defined in gen-sysinfo.go?  In <sys/termios.h>?  Does some other
>
> Only as
>
> // unknowndefine tIOC ('t'<<8)

Ah.

I committed this patch which may fix this problem.  Bootstrapped and ran
Go testsuite on x86_64-unknown-linux-gnu.  You'll have to remove
TARGET/libgo/s-sysinfo to force sysinfo.go to be rebuilt.

Ian


2011-09-23  Ian Lance Taylor  <i...@google.com>

        * godump.c (go_define): Treat a single character in single quotes,
        or a string, as an operand.


Index: godump.c
===================================================================
--- godump.c	(revision 178784)
+++ godump.c	(working copy)
@@ -301,11 +301,13 @@ go_define (unsigned int lineno, const ch
 	case '\'':
 	  {
 	    char quote;
+	    int count;
 
 	    if (saw_operand)
 	      goto unknown;
 	    quote = *p;
 	    *q++ = *p++;
+	    count = 0;
 	    while (*p != quote)
 	      {
 		int c;
@@ -313,6 +315,8 @@ go_define (unsigned int lineno, const ch
 		if (*p == '\0')
 		  goto unknown;
 
+		++count;
+
 		if (*p != '\\')
 		  {
 		    *q++ = *p++;
@@ -358,7 +362,15 @@ go_define (unsigned int lineno, const ch
 		    goto unknown;
 		  }
 	      }
+
 	    *q++ = *p++;
+
+	    if (quote == '\'' && count != 1)
+	      goto unknown;
+
+	    saw_operand = true;
+	    need_operand = false;
+
 	    break;
 	  }
 

Reply via email to