From 7098f8543850323a6dc311f909bd5c375c096727 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Wed, 9 Jan 2019 13:26:23 -0500 Subject: [PATCH] fixed bug where fetch tries to interpret argument as flags if it starts with a - --- config.h | 2 +- src/tide.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config.h b/config.h index 08ed519..a25f273 100644 --- a/config.h +++ b/config.h @@ -28,7 +28,7 @@ static char* ShellCmd[] = { 0, "-c", 0, 0 }; static char* SedCmd[] = { "sed", "-Ee", 0, 0 }; /* Command used to fetch some text based on a set of rules */ -static char* FetchCmd[] = { "fetch", 0, 0 }; +static char* FetchCmd[] = { "fetch", "--", 0, 0 }; /* Default tag region text in editor windows */ static char* TagString = "Del Put Undo Redo | Font Tabs Eol | Find "; diff --git a/src/tide.c b/src/tide.c index 625a2f6..626a0f6 100644 --- a/src/tide.c +++ b/src/tide.c @@ -152,7 +152,7 @@ static void mouse_right(WinRegion id, bool pressed, size_t row, size_t col) { if (PRESSED(MouseLeft)) { paste(NULL); } else { - FetchCmd[1] = view_fetch(win_view(id), row, col, risfile); + FetchCmd[2] = view_fetch(win_view(id), row, col, risfile); if (job_run(FetchCmd) != 0) { SearchDir *= (win_keymodsset(ModShift) ? -1 : +1); free(SearchTerm); @@ -160,7 +160,7 @@ static void mouse_right(WinRegion id, bool pressed, size_t row, size_t col) { view_findstr(win_view(EDIT), SearchDir, SearchTerm); SyncMouse = true; } - free(FetchCmd[1]); + free(FetchCmd[2]); } } -- 2.49.0