From 3ae5b6ddc5522e0d318d12cfa60180dbcef7d819 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 7 Aug 2010 22:13:12 -0400 Subject: [PATCH] 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. --- src/edit.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/edit.cpp b/src/edit.cpp index 74e78fb7e..c92f0496d 100644 --- a/src/edit.cpp +++ b/src/edit.cpp @@ -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