Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
strbuf_expand: convert "%%" to "%"
[gitweb.git]
/
strbuf.c
diff --git
a/strbuf.c
b/strbuf.c
index a6153dca278abe957254fa091fdcd8eb13b90b25..6cbc1fcfd86e45c85fda079f8bce8895adbcb3a4 100644
(file)
--- a/
strbuf.c
+++ b/
strbuf.c
@@
-227,6
+227,12
@@
void strbuf_expand(struct strbuf *sb, const char *format, expand_fn_t fn,
break;
format = percent + 1;
+ if (*format == '%') {
+ strbuf_addch(sb, '%');
+ format++;
+ continue;
+ }
+
consumed = fn(sb, format, context);
if (consumed)
format += consumed;