mirror of
https://github.com/git/git
synced 2024-10-30 14:03:28 +00:00
b1edb40f25
Add a function that returns a buffer containing the absolute path of its argument and a semantic patch for its intended use. It avoids an extra string copy to a static buffer. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 lines
161 B
Text
13 lines
161 B
Text
@@
|
|
expression E;
|
|
expression V;
|
|
@@
|
|
- if (E)
|
|
- V = xstrdup(E);
|
|
+ V = xstrdup_or_null(E);
|
|
|
|
@@
|
|
expression E;
|
|
@@
|
|
- xstrdup(absolute_path(E))
|
|
+ absolute_pathdup(E)
|