summaryrefslogtreecommitdiffstats
path: root/commands.c
diff options
context:
space:
mode:
authorBert Münnich <be.muennich@gmail.com>2013-08-22 09:44:14 +0200
committerBert Münnich <be.muennich@gmail.com>2013-08-22 09:44:14 +0200
commitfb6e4bdd980f72082a264894c12ed7e0650a5bf9 (patch)
tree4d14d6d4b792bb316afc1ef8c4bbaf337a2b6fe3 /commands.c
parent7d878bd16df1abffde780e195144b845dc133166 (diff)
downloadnsxiv-fb6e4bdd980f72082a264894c12ed7e0650a5bf9.tar.zst
Only print marked files when -o is given
Fallback to print all files, if no images are marked, was kind of irritating.
Diffstat (limited to 'commands.c')
-rw-r--r--commands.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/commands.c b/commands.c
index c1792a5..501a938 100644
--- a/commands.c
+++ b/commands.c
@@ -61,9 +61,9 @@ bool it_quit(arg_t a)
{
unsigned int i;
- if (options->to_stdout) {
+ if (options->to_stdout && markcnt > 0) {
for (i = 0; i < filecnt; i++) {
- if (!markcnt || files[i].marked)
+ if (files[i].marked)
printf("%s\n", files[i].name);
}
}