mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Fix compiler warning about unused variable
This was added to indicate that the return value of chdir was unused, but newer compilers "see through" this and determine it to be unused. The return value is not marked must-use, so just doing nothing with it is sufficient.
This commit is contained in:
parent
97bcc76ac1
commit
89d21bb380
1 changed files with 3 additions and 4 deletions
|
@ -619,10 +619,9 @@ CmdEdit::editResult CmdEdit::editFile(Task& task) {
|
|||
auto dateformat = Context::getContext().config.get("dateformat.edit");
|
||||
if (dateformat == "") dateformat = Context::getContext().config.get("dateformat");
|
||||
|
||||
// Change directory for the editor
|
||||
// Change directory for the editor, doing nothing on error.
|
||||
auto current_dir = Directory::cwd();
|
||||
int ignored = chdir(location._data.c_str());
|
||||
++ignored; // Keep compiler quiet.
|
||||
chdir(location._data.c_str());
|
||||
|
||||
// Check if the file already exists, if so, bail out
|
||||
Path filepath = Path(file.str());
|
||||
|
@ -702,7 +701,7 @@ ARE_THESE_REALLY_HARMFUL:
|
|||
|
||||
// Cleanup.
|
||||
File::remove(file.str());
|
||||
ignored = chdir(current_dir.c_str());
|
||||
chdir(current_dir.c_str());
|
||||
return changes ? CmdEdit::editResult::changes : CmdEdit::editResult::nochanges;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue