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

Empty string check broken for some variables #845

Closed
tiymat opened this issue Jul 28, 2024 · 2 comments
Closed

Empty string check broken for some variables #845

tiymat opened this issue Jul 28, 2024 · 2 comments
Labels
bug Unexpected behavior

Comments

@tiymat
Copy link
Contributor

tiymat commented Jul 28, 2024

Describe the bug:
When you set a variable to the output of a command that outputs the empty string, later checks of the variable's value won't report it as being equal to the empty string.

Expected behaviour:
When the output of a command that emits the empty string is saved to some variable var, $var == "" should be true.

Screenshots:
image

Platform (please complete the following information):

  • OS, output from uname -a if supported: 6.9.10-arch1-1
  • Terminal Emulator: kitty 0.35.2
  • Murex version, output from version --no-app-name: 6.2.3000

Additional context
Ran into this because it breaks the direnv hook.

I believe the change that causes this was introduced in the most recent release.

Seems to be related to the fact that the data type of the variable is set to *. If I change the command in the screenshot from printf "" to out "", it will behave as expected, presumably because out passes along the fact that the variable is a str through the pipe to set.

@tiymat tiymat added the bug Unexpected behavior label Jul 28, 2024
@lmorg lmorg added the in progress Issue is currently being worked on (possibly in a feature branch) label Jul 29, 2024
This was referenced Jul 29, 2024
@lmorg
Copy link
Owner

lmorg commented Jul 29, 2024

Thanks for reporting this. Added a few more tests to catch comparisons with generics and other data types so we don't see this regression again.

Pushed a fix to master. New binaries are being built....

@lmorg lmorg closed this as completed Jul 29, 2024
@tiymat
Copy link
Contributor Author

tiymat commented Jul 29, 2024

Many thanks!

@lmorg lmorg removed the in progress Issue is currently being worked on (possibly in a feature branch) label Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected behavior
Projects
None yet
Development

No branches or pull requests

2 participants