aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editors/sed.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/editors/sed.c b/editors/sed.c
index 5bfe924a5..75ed53eb7 100644
--- a/editors/sed.c
+++ b/editors/sed.c
@@ -43,11 +43,11 @@
43 Unsupported features: 43 Unsupported features:
44 44
45 - GNU extensions 45 - GNU extensions
46 - and lots, lots more. 46 - and more.
47 47
48 Bugs: 48 Bugs:
49 49
50 - Cant subst globally using ^ or $ in regex, eg. "aah" | sed 's/^a/b/g' 50 - lots
51 51
52 Reference http://www.opengroup.org/onlinepubs/007904975/utilities/sed.html 52 Reference http://www.opengroup.org/onlinepubs/007904975/utilities/sed.html
53*/ 53*/
@@ -299,7 +299,9 @@ static int parse_subst_cmd(sed_cmd_t * const sed_cmd, const char *substr)
299 while (substr[++idx]) { 299 while (substr[++idx]) {
300 switch (substr[idx]) { 300 switch (substr[idx]) {
301 case 'g': 301 case 'g':
302 sed_cmd->sub_g = 1; 302 if (match[0] != '^') {
303 sed_cmd->sub_g = 1;
304 }
303 break; 305 break;
304 /* Hmm, i dont see the I option mentioned in the standard */ 306 /* Hmm, i dont see the I option mentioned in the standard */
305 case 'I': 307 case 'I':