changeset 388:531a85706485 plus

use USER in tmpfile creation, output newline after header dict if it's the last one
author Henry S. Thompson <ht@inf.ed.ac.uk>
date Sat, 20 Jun 2026 16:39:46 +0100
parents 4eda36618ca2
children 2c04af3ca99a
files lib/python/cc/ix.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lib/python/cc/ix.py	Sat Jun 20 15:03:12 2026 +0100
+++ b/lib/python/cc/ix.py	Sat Jun 20 16:39:46 2026 +0100
@@ -47,7 +47,7 @@
 def process0(options,buf,filename,offset,length,whole):
   global TMPFILENAME, TMPFILE
   if options.save:
-    (tf,TMPFILENAME)=tempfile.mkstemp()
+    (tf,TMPFILENAME)=tempfile.mkstemp(dir="/tmp/"+(os.getenv('USER') or 'xyzzy'))
     TMPFILE=open(tf,mode='wb')
   if options.cmd and not options.process:
     launch(options.cmd)
@@ -196,6 +196,8 @@
           # Blank line, HTTP header is finished
           if isinstance(options.headers,dict):
             _output(bytes(str(options.headers),'utf-8'))
+            if not options.body:
+              _output(b'\n')
           if not options.body:
             return
           if options.headers: