diff options
author | Daniel Carl <danielcarl@gmx.de> | 2017-04-26 23:43:24 +0200 |
---|---|---|
committer | Daniel Carl <danielcarl@gmx.de> | 2017-04-26 23:43:24 +0200 |
commit | f4909eee293b18ed6609217138e0506b04fc2169 (patch) | |
tree | 22921a90d2539d9d01d7baca51f288bccea01112 /src/normal.c | |
parent | edd5bec6617d600617b7925ce3e811a7c43502a5 (diff) |
Allow to store multiple closed URLs #379.
Applied changes of 8ae4cadf58e46b3e9951fa89cf084bd2792984c3 in master
branch to new infrastructure.
Diffstat (limited to 'src/normal.c')
-rw-r--r-- | src/normal.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/normal.c b/src/normal.c index a951b6c..5a43836 100644 --- a/src/normal.c +++ b/src/normal.c @@ -597,12 +597,15 @@ static VbResult normal_open_clipboard(Client *c, const NormalCmdInfo *info) static VbResult normal_open(Client *c, const NormalCmdInfo *info) { Arg a; - char *file; + if (!vb.files[FILES_CLOSED]) { + return RESULT_ERROR; + } - file = g_build_filename(util_get_config_dir(), FILE_CLOSED, NULL); a.i = info->key == 'U' ? TARGET_NEW : TARGET_CURRENT; - a.s = util_get_file_contents(file, NULL); - g_free(file); + a.s = util_file_pop_line(vb.files[FILES_CLOSED], NULL); + if (!a.s) { + return RESULT_ERROR; + } vb_load_uri(c, &a); g_free(a.s); |