=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/compile_et/Attic/error_table.y,v retrieving revision 1.6 retrieving revision 1.7 diff -c -r1.6 -r1.7 *** src/usr.bin/compile_et/Attic/error_table.y 2005/05/13 05:05:22 1.6 --- src/usr.bin/compile_et/Attic/error_table.y 2005/10/17 07:35:29 1.7 *************** *** 1,6 **** %{ /* ! * Copyright (c) 1998, 1999 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * --- 1,6 ---- %{ /* ! * Copyright (c) 1998 - 2000 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * *************** *** 15,26 **** * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * ! * 3. All advertising materials mentioning features or use of this software ! * must display the following acknowledgement: ! * This product includes software developed by Kungliga Tekniska ! * Högskolan and its contributors. ! * ! * 4. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * --- 15,21 ---- * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * ! * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * *************** *** 38,47 **** */ #include "compile_et.h" - /* RCSID("$KTH: parse.y,v 1.9 1999/07/04 14:54:58 assar Exp $"); */ void yyerror (char *s); ! long name2number(const char *str); void error_message(char *, ...); extern char *yytext; --- 33,43 ---- */ #include "compile_et.h" + /* RCSID("$KTH: parse.y,v 1.13 2005/05/16 08:53:34 lha Exp $"); */ + void yyerror (char *s); ! static long name2number(const char *str); void error_message(char *, ...); extern char *yytext; *************** *** 105,143 **** } | PREFIX STRING { ! size_t len = strlen($2) + 2; ! ! if ((prefix = realloc(prefix, len)) == NULL) { ! yyerror(strerror(errno)); ! exit(1); ! } ! strlcpy(prefix, $2, len); ! strlcat(prefix, "_", len); free($2); } | PREFIX { ! if ((prefix = realloc(prefix, 1)) == NULL) { ! yyerror(strerror(errno)); ! exit(1); ! } *prefix = '\0'; } | EC STRING ',' STRING { struct error_code *ec = malloc(sizeof(*ec)); ! ! if (ec == NULL) { ! yyerror(strerror(errno)); ! exit(1); ! } ec->next = NULL; ec->number = number; if(prefix && *prefix != '\0') { ! if (asprintf (&ec->name, "%s%s", prefix, $2) == -1) { ! yyerror(strerror(errno)); ! exit(1); ! } free($2); } else ec->name = $2; --- 101,132 ---- } | PREFIX STRING { ! free(prefix); ! asprintf (&prefix, "%s_", $2); ! if (prefix == NULL) ! errx(1, "malloc"); free($2); } | PREFIX { ! prefix = realloc(prefix, 1); ! if (prefix == NULL) ! errx(1, "malloc"); *prefix = '\0'; } | EC STRING ',' STRING { struct error_code *ec = malloc(sizeof(*ec)); ! ! if (ec == NULL) ! errx(1, "malloc"); ! ec->next = NULL; ec->number = number; if(prefix && *prefix != '\0') { ! asprintf (&ec->name, "%s%s", prefix, $2); ! if (ec->name == NULL) ! errx(1, "malloc"); free($2); } else ec->name = $2; *************** *** 153,159 **** %% ! long name2number(const char *str) { const char *p; --- 142,148 ---- %% ! static long name2number(const char *str) { const char *p;