diff --git a/string.c b/string.c index c2f2a88..51f6902 100644 --- a/string.c +++ b/string.c @@ -471,6 +471,7 @@ struct string *string_format(struct string *fmt, union vm_value arg) parse_fmt_spec(&s, &spec); append_fmt(&out, &spec, arg); string_append_cstr(&out, s, strlen(s)); + break; } } return out; diff --git a/test/Source/strings.jaf b/test/Source/strings.jaf index 1760c58..1cc6319 100755 --- a/test/Source/strings.jaf +++ b/test/Source/strings.jaf @@ -72,6 +72,7 @@ void test_strings(void) test_string("abc%Ddef % 42", "abc%Ddef" % 42, "abc‚S‚Qdef"); test_string("abc%4Ddef % 42", "abc%4Ddef" % 42, "abc@@‚S‚Qdef"); test_string("abc%04Ddef % 42", "abc%04Ddef" % 42, "abc‚O‚O‚S‚Qdef"); + test_string("\"%d %d\" % 42 % 43", "%d %d" % 42 % 43, "42 43"); // float test_string("abc%fdef % 12.3", "abc%fdef" % 12.3, "abc12.300000def"); test_string("abc%.2fdef % 12.3", "abc%.2fdef" % 12.3, "abc12.30def");