Pull fix from master branch, and correct filename juggling.

The original fix was in p4 144906.  This also corrects some problems that
arise when the temp file is specified.
2 files changed