*************** *** 257,280 **** to make temp file in same dir as original, we make p point to the filename component of fname, put '\0' there, and strcat the temp name to it */ - strcpy (tfname, fname); - p = tfname + strlen(tfname); - while (p != tfname && *p != '/' && *p != '\\') - p--; - if (p != tfname) - p++; - *p = '\0'; #define TEMPLATE "XXXXXX" - { - char template[7]; - strcpy (template, TEMPLATE); - strcat (tfname, mktemp (template)); - } - - outfile = fopen (tfname, WB); if (outfile == NULL) { fclose (infile); error (fname, ": skipped, could not open temporary file"); --- 264,291 ---- to make temp file in same dir as original, we make p point to the filename component of fname, put '\0' there, and strcat the temp name to it */ + if(!use_stdio) { + strcpy (tfname, fname); + p = tfname + strlen(tfname); + while (p != tfname && *p != '/' && *p != '\\') + p--; + if (p != tfname) + p++; + *p = '\0'; #define TEMPLATE "XXXXXX" + { + char template[7]; + strcpy (template, TEMPLATE); + strcat (tfname, mktemp (template)); + } + outfile = fopen (tfname, WB); + } else { + outfile = stdout; + } + if (outfile == NULL) { fclose (infile); error (fname, ": skipped, could not open temporary file");