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>
14 lines
161 B
Plaintext
14 lines
161 B
Plaintext
@@
|
|
expression E;
|
|
expression V;
|
|
@@
|
|
- if (E)
|
|
- V = xstrdup(E);
|
|
+ V = xstrdup_or_null(E);
|
|
|
|
@@
|
|
expression E;
|
|
@@
|
|
- xstrdup(absolute_path(E))
|
|
+ absolute_pathdup(E)
|