aboutsummaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authorRobert Griebl <griebl@gmx.de>2002-08-06 21:07:17 +0000
committerRobert Griebl <griebl@gmx.de>2002-08-06 21:07:17 +0000
commit7940147e2516b7042cff956acb98aca39007fdb8 (patch)
treefed33e2a4a2606419078e1df49fddbe294fbf6a7 /editors
parentedcac5572f2a52fca7975dee53ca4f1e6d0a36eb (diff)
downloadbusybox-7940147e2516b7042cff956acb98aca39007fdb8.tar.gz
Added the \CregexpC syntax as an alternative for /regexp/ (like GNU sed)
Diffstat (limited to 'editors')
-rw-r--r--editors/sed.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/editors/sed.c b/editors/sed.c
index 84aea9b0a..5fc3a14a5 100644
--- a/editors/sed.c
+++ b/editors/sed.c
@@ -194,7 +194,11 @@ static int get_address(struct sed_cmd *sed_cmd, const char *str, int *linenum, r
*linenum = -1;
idx++;
}
- else if (my_str[idx] == '/') {
+ else if (my_str[idx] == '/' || my_str[idx] == '\\') {
+ if (my_str[idx] == '\\') {
+ my_str[idx] = 0;
+ sed_cmd-> delimiter = my_str[++idx];
+ }
idx = index_of_next_unescaped_regexp_delim(sed_cmd, my_str, ++idx);
if (idx == -1)
error_msg_and_die("unterminated match expression");