mirror of
https://github.com/git/git
synced 2024-08-25 02:35:46 +00:00
![René Scharfe](/assets/img/avatar_default.png)
Support an arbitrary file descriptor expression in the semantic patch for replacing open+die_errno with xopen, not just an identifier, and apply it. This makes the error message at the single affected place more consistent and reduces code duplication. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 lines
295 B
Plaintext
20 lines
295 B
Plaintext
@@
|
|
identifier fd;
|
|
identifier die_fn =~ "^(die|die_errno)$";
|
|
@@
|
|
int fd =
|
|
- open
|
|
+ xopen
|
|
(...);
|
|
- if ( \( fd < 0 \| fd == -1 \) ) { die_fn(...); }
|
|
|
|
@@
|
|
expression fd;
|
|
identifier die_fn =~ "^(die|die_errno)$";
|
|
@@
|
|
fd =
|
|
- open
|
|
+ xopen
|
|
(...);
|
|
- if ( \( fd < 0 \| fd == -1 \) ) { die_fn(...); }
|