File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
src/main/java/org/perlonjava/operators Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -318,8 +318,13 @@ public static RuntimeScalar pack(RuntimeList args) {
318318 // Need to look back, skipping any modifiers and repeat counts
319319 int numericPos = i - 1 ;
320320
321+ // Skip back over whitespace FIRST
322+ while (numericPos >= 0 && Character .isWhitespace (template .charAt (numericPos ))) {
323+ numericPos --;
324+ }
325+
321326 // Skip back over repeat counts and '*'
322- if (numericPos > 0 && (template .charAt (numericPos ) == '*' || Character .isDigit (template .charAt (numericPos )))) {
327+ if (numericPos >= 0 && (template .charAt (numericPos ) == '*' || Character .isDigit (template .charAt (numericPos )))) {
323328 if (template .charAt (numericPos ) == '*' ) {
324329 // Skip the '*' to get to the format
325330 numericPos --;
You can’t perform that action at this time.
0 commit comments