emersion / emersion/mrsh

assignment followed by expansion of null/unset word fails assertion

Open
#203 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
531
Forks
40
PR merge metrics
No merged PRs in 30d

Description

command:
```sh
a=a $b
```
output:
```
mrsh: ../shell/task/simple_command.c:286: run_simple_command: Assertion `args.len > 0' failed.
fish: Job 1, './buildDir/mrsh' terminated by signal SIGABRT (Abort)
```
I think the issue is [here](https://github.com/emersion/mrsh/blob/869fba0814b0c9256de536714f8ccbcf0369b391/shell/task/simple_command.c#L241), which checks if there is a word that isn't an assignment, but this isn't correct because the word could expand to nothing.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.