Skip to content

Commit 119ffa3

Browse files
committed
Merge branch 'cc/quote-comments' into maint
A no-op code-health maintenance. * cc/quote-comments: quote: move comment before sq_quote_buf() quote: fix broken sq_quote_buf() related comment
2 parents 71ae535 + 44cd91e commit 119ffa3

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

quote.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@
44

55
int quote_path_fully = 1;
66

7+
static inline int need_bs_quote(char c)
8+
{
9+
return (c == '\'' || c == '!');
10+
}
11+
712
/* Help to copy the thing properly quoted for the shell safety.
813
* any single quote is replaced with '\'', any exclamation point
914
* is replaced with '\!', and the whole thing is enclosed in a
15+
* single quote pair.
1016
*
1117
* E.g.
1218
* original sq_quote result
@@ -15,11 +21,6 @@ int quote_path_fully = 1;
1521
* a'b ==> a'\''b ==> 'a'\''b'
1622
* a!b ==> a'\!'b ==> 'a'\!'b'
1723
*/
18-
static inline int need_bs_quote(char c)
19-
{
20-
return (c == '\'' || c == '!');
21-
}
22-
2324
void sq_quote_buf(struct strbuf *dst, const char *src)
2425
{
2526
char *to_free = NULL;

0 commit comments

Comments
 (0)