about summary refs log tree commit homepage
path: root/bin/dtas-sourceedit
diff options
context:
space:
mode:
Diffstat (limited to 'bin/dtas-sourceedit')
-rwxr-xr-xbin/dtas-sourceedit6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/dtas-sourceedit b/bin/dtas-sourceedit
index 0c8aeb5..87d16ee 100755
--- a/bin/dtas-sourceedit
+++ b/bin/dtas-sourceedit
@@ -22,16 +22,16 @@ abort(buf) if buf =~ /\AERR/
 orig = YAML.load(buf)
 
 if st_in.file? || st_in.pipe?
-  tmp = $stdin
+  buf = $stdin.read
 else
   tmp = tmpyaml
   tmp.write(buf << DTAS_DISCLAIMER)
   cmd = "#{editor} #{tmp.path}"
   system(cmd) or abort "#{cmd} failed: #$?"
-  tmp.rewind
+  buf = File.read(tmp.path)
 end
 
-source = YAML.load(tmp.read)
+source = YAML.load(buf)
 cmd = %W(source ed #{name})
 update_cmd_env(cmd, orig, source)