1 /* Test case derived from Binutils/GDB's readline/readline/histexpand.c.
3 { dg-options "-O2 -Wall" } */
6 get_subst_pattern (char *str
, int *iptr
, int delimiter
, int is_rhs
, int *lenptr
)
14 for (si
= i
; str
[si
] && str
[si
] != delimiter
; si
++)
15 if (str
[si
] == '\\' && str
[si
+ 1] == delimiter
)
20 s
= (char *)__builtin_malloc (si
- i
+ 1);
21 for (j
= 0, k
= i
; k
< si
; j
++, k
++)
23 /* Remove a backslash quoting the search string delimiter. */
24 if (str
[k
] == '\\' && str
[k
+ 1] == delimiter
)
26 s
[j
] = str
[k
]; // { dg-bogus "-Wstringop-overflow" }