Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra \n in unterminated aic command at EOF #2

Open
aureliojargas opened this issue Nov 17, 2019 · 0 comments
Open

Extra \n in unterminated aic command at EOF #2

aureliojargas opened this issue Nov 17, 2019 · 0 comments
Labels
bug Something isn't working

Comments

@aureliojargas
Copy link
Owner

$ cat x.sed 
3i\
foo\
$ sedparse -f x.sed 
[
    {
        "a1": {
            "addr_number": 3,
            "addr_type": 3
        },
        "cmd": "i",
        "line": 1,
        "x": {
            "cmd_txt": {
                "text": [
                    "f",
                    "o",
                    "o",
                    "\\",
                    "\n",
                    "\n"
                ]
            }
        }
    }
]
$

Note that inside x.cmd_txt.text, there's a double \n when there should be only one.

In the x.sed file, the last line is foo\, which implies there will be a new line to the i command text. But there isn't. Note that for GNU sed, it works the same as if it was a normal foo in the last line:

$ seq 5 | sed -e '3i\' -e 'foo'
1
2
foo
3
4
5
$ seq 5 | sed -e '3i\' -e 'foo\'
1
2
foo
3
4
5
$

sedparse should not return that extra \n in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant