Skip to content

Commit

Permalink
Fix wrong parsing of 'xN' repetitions in 'input' command.
Browse files Browse the repository at this point in the history
  • Loading branch information
dtschump committed Nov 15, 2023
1 parent 5930dcd commit d3f91c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gmic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14016,9 +14016,9 @@ gmic& gmic::_run(const CImgList<char>& commands_line, unsigned int& position,
if (is_verbose) selection2string(selection,images_names,0,_gmic_selection);

char *last_x = std::strrchr(arg_input,'x');
if (last_x && cimg_sscanf(last_x + 1,"%d%c",&nb,&end)==1 && nb>0) *last_x = 0; else { last_x = 0; nb = 1; }
if (last_x && last_x[1]!='+' && cimg_sscanf(last_x + 1,"%d%c",&nb,&end)==1 && nb>0) *last_x = 0;
else { last_x = 0; nb = 1; }
unsigned int larg = 0;

if (*arg_input=='0' && !arg_input[1]) {

// Empty image(s).
Expand Down

0 comments on commit d3f91c2

Please sign in to comment.