Skip to content

Commit a9e57d5

Browse files
committed
prefer case-sensitive %(variable) match if present
1 parent 3457271 commit a9e57d5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/argv.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,13 @@ format_expand_arg(struct format_context *format, const char *name, const char *e
325325
return string_format_from(format->buf, &format->bufpos, "%s", value);
326326
}
327327

328+
for (i = 0; i < format->vars_size; i++) {
329+
if (strncmp(name, vars[i].name, vars[i].namelen))
330+
continue;
331+
332+
return vars[i].formatter(format, &vars[i]);
333+
}
334+
328335
for (i = 0; i < format->vars_size; i++) {
329336
if (string_enum_compare(name, vars[i].name, vars[i].namelen))
330337
continue;

0 commit comments

Comments
 (0)