]> mj.ucw.cz Git - paperjam.git/commitdiff
Fix ranges in select command
authorMartin Mares <mj@ucw.cz>
Fri, 13 Apr 2018 21:14:06 +0000 (23:14 +0200)
committerMartin Mares <mj@ucw.cz>
Fri, 13 Apr 2018 21:14:06 +0000 (23:14 +0200)
cmds.cc

diff --git a/cmds.cc b/cmds.cc
index 73daa4cbc4211419c3a939f11a8e833c9c5b8d08..9ce9e03ac70d34615b939dddeb87a3fc95e3e8c4 100644 (file)
--- a/cmds.cc
+++ b/cmds.cc
@@ -575,7 +575,7 @@ vector<page *> select_cmd::process(vector<page *> &pages)
          int f = validate_page_index(pages, ps.from);
          int t = validate_page_index(pages, ps.to);
          int step = (f <= t) ? 1 : -1;
-         for (int i=f; f<=t; f += step)
+         for (int i=f; i<=t; i += step)
            selected.push_back(pages[i]);
        }
       auto processed = run_command_list(pb->commands, selected);