From 857f711e0f1ab3b8b1261cea6efdac5852bbdde2 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Wed, 16 Oct 2024 21:05:26 +0200 Subject: [PATCH] Simplify extract_desc() (#601) Overlooked in commit 79eee54 from last week. --- run-test262.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/run-test262.c b/run-test262.c index 58f3fb8..9f44ac4 100644 --- a/run-test262.c +++ b/run-test262.c @@ -1556,7 +1556,7 @@ fail: return 1; } -char *extract_desc(const char *buf, char style) +char *extract_desc(const char *buf) { const char *p, *desc_start; char *desc; @@ -1564,7 +1564,7 @@ char *extract_desc(const char *buf, char style) p = buf; while (*p != '\0') { - if (p[0] == '/' && p[1] == '*' && p[2] == style && p[3] != '/') { + if (p[0] == '/' && p[1] == '*' && p[2] == '-' && p[3] != '/') { p += 3; desc_start = p; while (*p != '\0' && (p[0] != '*' || p[1] != '/')) @@ -1787,7 +1787,7 @@ int run_test(const char *filename, int *msec) namelist_add(ip, NULL, "assert.js"); } /* extract the YAML frontmatter */ - desc = extract_desc(buf, '-'); + desc = extract_desc(buf); if (desc) { char *ifile, *option; int state;