diff options
author | Eric Wong <normalperson@yhbt.net> | 2013-09-23 05:26:16 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2013-09-23 05:26:16 +0000 |
commit | 2118e3aa78ebbd91b9d10ec524186820cbfa9c50 (patch) | |
tree | cccce81bf566d628f26e332e353f5b4d1e4359a9 /bin/dtas-sinkedit | |
parent | dfb00324795c2a1c8bbe8d191b3a610e508b1032 (diff) | |
download | dtas-2118e3aa78ebbd91b9d10ec524186820cbfa9c50.tar.gz |
We must not assume the temporary file remains in place while $EDITOR/$VISUAL is running, as it is common for editors to rename over a file to atomically replace existing files.
Diffstat (limited to 'bin/dtas-sinkedit')
-rwxr-xr-x | bin/dtas-sinkedit | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/bin/dtas-sinkedit b/bin/dtas-sinkedit index 93a4fe9..8a42a7b 100755 --- a/bin/dtas-sinkedit +++ b/bin/dtas-sinkedit @@ -18,8 +18,7 @@ orig = YAML.load(buf) tmp.write(buf << DTAS_DISCLAIMER) cmd = "#{editor} #{tmp.path}" system(cmd) or abort "#{cmd} failed: #$?" -tmp.rewind -sink = YAML.load(tmp.read) +sink = YAML.load(File.read(tmp.path)) cmd = %W(sink ed #{name}) update_cmd_env(cmd, orig, sink) |