diff options
Diffstat (limited to 'src/actions.c')
-rw-r--r-- | src/actions.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/actions.c b/src/actions.c index 3b2692e..7e4fdc3 100644 --- a/src/actions.c +++ b/src/actions.c @@ -5962,11 +5962,17 @@ cmd_putsel (int interactive UNUSED, struct cmdarg **args) cmdret * cmd_getsel (int interactive UNUSED, struct cmdarg **args UNUSED) { - char *sel = get_selection(); + char *sel; cmdret *ret; - ret = cmdret_new (RET_SUCCESS, "%s", sel); - free (sel); - return ret; + sel = get_selection(); + if (sel != NULL) + { + ret = cmdret_new (RET_SUCCESS, "%s", sel); + free (sel); + return ret; + } + else + return cmdret_new (RET_FAILURE, "getsel: no X11 selection"); } /* This is a command that restores old commands that have been |