Commit a76e98f0 authored by Michael Meskes's avatar Michael Meskes

Fixed test for output_filename == stdout.

parent f06b7604
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.header,v 1.1 2008/11/14 10:03:33 meskes Exp $ */ /* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.header,v 1.2 2008/11/14 16:25:34 meskes Exp $ */
/* Copyright comment */ /* Copyright comment */
%{ %{
...@@ -94,7 +94,8 @@ mmerror(int error_code, enum errortype type, char * error, ...) ...@@ -94,7 +94,8 @@ mmerror(int error_code, enum errortype type, char * error, ...)
fclose(yyin); fclose(yyin);
if (yyout) if (yyout)
fclose(yyout); fclose(yyout);
if (unlink(output_filename) != 0 && *output_filename != '-')
if (strcmp(output_filename, "-") != 0 && unlink(output_filename) != 0)
fprintf(stderr, _("could not remove output file \"%s\"\n"), output_filename); fprintf(stderr, _("could not remove output file \"%s\"\n"), output_filename);
exit(error_code); exit(error_code);
} }
......
/* header */ /* header */
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.383 2008/11/13 11:54:39 meskes Exp $ */ /* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.384 2008/11/14 16:25:34 meskes Exp $ */
/* Copyright comment */ /* Copyright comment */
%{ %{
...@@ -95,7 +95,8 @@ mmerror(int error_code, enum errortype type, char * error, ...) ...@@ -95,7 +95,8 @@ mmerror(int error_code, enum errortype type, char * error, ...)
fclose(yyin); fclose(yyin);
if (yyout) if (yyout)
fclose(yyout); fclose(yyout);
if (unlink(output_filename) != 0 && *output_filename != '-')
if (strcmp(output_filename, "-") != 0 && unlink(output_filename) != 0)
fprintf(stderr, _("could not remove output file \"%s\"\n"), output_filename); fprintf(stderr, _("could not remove output file \"%s\"\n"), output_filename);
exit(error_code); exit(error_code);
} }
...@@ -390,7 +391,7 @@ add_typedef(char *name, char * dimension, char * length, enum ECPGttype type_enu ...@@ -390,7 +391,7 @@ add_typedef(char *name, char * dimension, char * length, enum ECPGttype type_enu
struct prep prep; struct prep prep;
} }
/* tokens */ /* tokens */
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.383 2008/11/13 11:54:39 meskes Exp $ */ /* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.384 2008/11/14 16:25:34 meskes Exp $ */
/* special embedded SQL token */ /* special embedded SQL token */
%token SQL_ALLOCATE SQL_AUTOCOMMIT SQL_BOOL SQL_BREAK %token SQL_ALLOCATE SQL_AUTOCOMMIT SQL_BOOL SQL_BREAK
SQL_CALL SQL_CARDINALITY SQL_CONNECT SQL_CALL SQL_CARDINALITY SQL_CONNECT
...@@ -847,7 +848,7 @@ add_typedef(char *name, char * dimension, char * length, enum ECPGttype type_enu ...@@ -847,7 +848,7 @@ add_typedef(char *name, char * dimension, char * length, enum ECPGttype type_enu
%type <str> reserved_keyword %type <str> reserved_keyword
%type <str> SpecialRuleRelation %type <str> SpecialRuleRelation
/* ecpgtype */ /* ecpgtype */
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.383 2008/11/13 11:54:39 meskes Exp $ */ /* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.384 2008/11/14 16:25:34 meskes Exp $ */
%type <str> ECPGAllocateDescr %type <str> ECPGAllocateDescr
%type <str> ECPGCKeywords %type <str> ECPGCKeywords
%type <str> ECPGColId %type <str> ECPGColId
...@@ -9343,6 +9344,8 @@ mmerror(PARSE_ERROR, ET_WARNING, "unsupported feature will be passed to backend\ ...@@ -9343,6 +9344,8 @@ mmerror(PARSE_ERROR, ET_WARNING, "unsupported feature will be passed to backend\
/* trailer */ /* trailer */
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.384 2008/11/14 16:25:34 meskes Exp $ */
statements: /*EMPTY*/ statements: /*EMPTY*/
| statements statement | statements statement
; ;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment