summaryrefslogtreecommitdiff
path: root/src/note.c
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2014-07-16 23:53:30 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2014-07-16 23:53:30 +0200
commit71234ec0bd16c490239eefcf98069ceb7a7f7618 (patch)
tree96700d7cbdf97ca7f1906948be66548712b15226 /src/note.c
parentb37ed2fcc8a4c64419cf066d3c940fc29b7a2d73 (diff)
downloadcalcurse-71234ec0bd16c490239eefcf98069ceb7a7f7618.zip
Refactor wins_launch_external()
Allow for passing an arbitrary number of arguments. This also allows us to remove wins_launch_external2() and use wins_launch_external() at all call sites instead. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src/note.c')
-rw-r--r--src/note.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/note.c b/src/note.c
index 9bce762..882d1a6 100644
--- a/src/note.c
+++ b/src/note.c
@@ -95,7 +95,8 @@ void edit_note(char **note, const char *editor)
io_file_cp(notepath, tmppath);
}
- wins_launch_external(tmppath, editor);
+ const char *arg[] = { editor, tmppath, NULL };
+ wins_launch_external(arg);
if (io_file_is_empty(tmppath) > 0) {
erase_note(note);
@@ -119,7 +120,9 @@ void view_note(const char *note, const char *pager)
if (note == NULL)
return;
snprintf(fullname, BUFSIZ, "%s%s", path_notes, note);
- wins_launch_external(fullname, pager);
+
+ const char *arg[] = { pager, fullname, NULL };
+ wins_launch_external(arg);
}
/* Erase a note previously attached to an item. */