Bug #442 - "task edit" fails on Cygwin when using a Windows editor

- Made a partial fix that at least allows any editor to be launched,
  and that can then locate the file.
- Not addressed is the fact that some launchable Windows editors need
  Windows line encodings, and other are flexible.
This commit is contained in:
Paul Beckingham 2010-08-07 22:13:12 -04:00
parent a306892509
commit 3ae5b6ddc5

View file

@ -530,10 +530,12 @@ void editFile (Task& task)
// Create a temp file name in data.location.
std::stringstream file;
file << location.data << "/task." << getpid () << "." << task.id << ".task";
file << "task." << getpid () << "." << task.id << ".task";
std::string path = location.data + "/" + file.str ();
// Format the contents, T -> text, write to a file.
std::string before = formatTask (task);
chdir (location.data.c_str ());
File::write (file.str (), before);
// Determine correct editor: .taskrc:editor > $VISUAL > $EDITOR > vi