MCPcopy Index your code
hub / github.com/git/git / attr_value_unescape

Function attr_value_unescape

pathspec.c:172–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170}
171
172static char *attr_value_unescape(const char *value)
173{
174 const char *src;
175 char *dst, *ret;
176
177 ret = xmallocz(strlen(value));
178 for (src = value, dst = ret; *src; src++, dst++) {
179 if (*src == '\\') {
180 if (!src[1])
181 die(_("Escape character '\\' not allowed as "
182 "last character in attr value"));
183 src++;
184 }
185 if (invalid_value_char(*src))
186 die("cannot use '%c' for value matching", *src);
187 *dst = *src;
188 }
189 *dst = '\0';
190 return ret;
191}
192
193static void parse_pathspec_attr_match(struct pathspec_item *item, const char *value)
194{

Callers 1

Calls 3

xmalloczFunction · 0.85
invalid_value_charFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected