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

make: 'bash: set +o posix: command not found' when IFS=$'\n' #143

Closed
mgorny opened this issue Jul 2, 2017 · 3 comments
Closed

make: 'bash: set +o posix: command not found' when IFS=$'\n' #143

mgorny opened this issue Jul 2, 2017 · 3 comments

Comments

@mgorny
Copy link
Contributor

mgorny commented Jul 2, 2017

To reproduce:

$ IFS=$'\n'
$ make <tab>

It causes the output to look like:

$ make bash: set +o posix: command not found
bash: set +o posix: command not found

Display all 124 possibilities? (y or n)

etc., i.e. it works but prints two set +o posix errors every time it completes.

Original report: https://bugs.gentoo.org/530246

@scop
Copy link
Owner

scop commented Jul 3, 2017

This in completions/make appears to be one candidate fix, not sure if it's the best one:

-        $reset
+        local IFS+=' '; $reset

And we probably have a bunch of other cases (at least all similar shopt constructs) lurking here and there, possibly others as well. Not sure if we should even try to support arbitrary IFS environments...

@mgorny
Copy link
Contributor Author

mgorny commented Jul 3, 2017

Well, to be honest I don't know whether it's worth supporting either. This has been reported by an user who actually did hit this, so might be worth fixing it on per-case basis. However, if you feel like it's too much of an hassle, feel free to reject it and I'll forward the answer appropriately.

As for the technical details, I'm afraid IFS is too much of a brainf* for me. I always get lost on where it exactly gets used and where not. I'm not sure if the best solution wouldn't be to simply override IFS for the whole function scope, unless we actually need to respect it somewhere.

@scop scop closed this as completed in 5240618 Jul 9, 2017
@scop
Copy link
Owner

scop commented Jul 9, 2017

There's no central place we could use for setting an expected IFS, so I opted to tweak the cases I could find. I kept the IFS setting close to where it's needed in order to give a hint/reminder why it is there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants