diff --git a/libiberty/argv.c b/libiberty/argv.c index a95a10e14ff44c9a0d4499fc91a40ccb68244417..1a18b4d886666907bdafad2c16f00f8a520557e3 100644 --- a/libiberty/argv.c +++ b/libiberty/argv.c @@ -289,8 +289,8 @@ char **buildargv (const char *input) @deftypefn Extension int writeargv (char * const *@var{argv}, FILE *@var{file}) Write each member of ARGV, handling all necessary quoting, to the file -named by FILE, separated by whitespace. Return 0 on success, non-zero -if an error occurred while writing to FILE. +associated with FILE, separated by whitespace. Return 0 on success, +non-zero if an error occurred while writing to FILE. @end deftypefn @@ -314,36 +314,25 @@ writeargv (char * const *argv, FILE *f) if (ISSPACE(c) || c == '\\' || c == '\'' || c == '"') if (EOF == fputc ('\\', f)) - { - status = 1; - goto done; - } + return 1; if (EOF == fputc (c, f)) - { - status = 1; - goto done; - } + return 1; + arg++; } /* Write out a pair of quotes for an empty argument. */ if (arg == *argv) - if (EOF == fputs ("\"\"", f)) - { - status = 1; - goto done; - } + if (EOF == fputs ("\"\"", f)) + return 1; if (EOF == fputc ('\n', f)) - { - status = 1; - goto done; - } + return 1; + argv++; } - done: return status; }