From 4e10f943ffa530969cb251ccbbf848b8084e1e11 Mon Sep 17 00:00:00 2001
From: "Brian S. Dean" <bsd@bsdhome.com>
Date: Wed, 7 May 2003 22:13:46 +0000
Subject: [PATCH] fileio.c : Remove superfluous assignment of 'fname'.

main.c : print out '<stdin>' and '<stdout>' instead of '-' when using
         stdio for I/O.

Thanks to Francisco T. A. Silva <ftas@geodigitus.com.br> for catching
this, and the error fixed by the previous commit as well.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@325 81a1dc3b-b13d-400b-aceb-764788c761c2
---
 avrdude/fileio.c | 1 -
 avrdude/main.c   | 4 ++--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/avrdude/fileio.c b/avrdude/fileio.c
index ef6a5c1b..f3806215 100644
--- a/avrdude/fileio.c
+++ b/avrdude/fileio.c
@@ -1019,7 +1019,6 @@ int fileio(int op, char * filename, FILEFMT format,
 
   if (format != FMT_IMM) {
     if (!using_stdio) {
-      fname = filename;
       f = fopen(fname, fio.mode);
       if (f == NULL) {
         fprintf(stderr, "%s: can't open %s file %s: %s\n",
diff --git a/avrdude/main.c b/avrdude/main.c
index 12fbb1d2..c1d50fc5 100644
--- a/avrdude/main.c
+++ b/avrdude/main.c
@@ -887,7 +887,7 @@ int main(int argc, char * argv [])
     size = rc;
 
     fprintf(stderr, "%s: writing output file \"%s\"\n",
-            progname, outputf);
+            progname, strcmp(outputf, "-")==0 ? "<stdout>" : outputf);
     rc = fileio(FIO_WRITE, outputf, filefmt, p, memtype, size);
     if (rc < 0) {
       fprintf(stderr, "%s: terminating\n", progname);
@@ -902,7 +902,7 @@ int main(int argc, char * argv [])
      * read the data from the specified file
      */
     fprintf(stderr, "%s: reading input file \"%s\"\n",
-            progname, inputf);
+            progname, strcmp(inputf, "-")==0 ? "<stdin>" : inputf);
     rc = fileio(FIO_READ, inputf, filefmt, p, memtype, -1);
     if (rc < 0) {
       fprintf(stderr, "%s: terminating\n", progname);