SQFvm / runtime

Custom implementation of the Arma script language SQF
GNU Lesser General Public License v3.0
96 stars 30 forks source link

[BUG] `--cli-file` command line parameter broken #224

Closed artemoz closed 10 months ago

artemoz commented 10 months ago

Runtime refuses to start when --cli-file parameter is provided.

To Reproduce Steps to reproduce the behavior:

  1. Create an empty CLI file (e.g. cli.cfg)
  2. Run sqfvm --cli-file ./cli.cfg

Actual result '"./cli.cfg"' is not allowed inside of the actual file!. error message, sqfvm not running

Expected behavior sqfvm running

Additional context I've only tested windows_x64 builds. Does reproduce on the latest development build available in Actions https://github.com/SQFvm/runtime/actions/runs/6331652376 Does reproduce on the latest master build available in Actions https://github.com/SQFvm/runtime/actions/runs/6325629380 Does reproduce on the oldest build ever still available in Actions https://github.com/SQFvm/runtime/actions/runs/5764179067

Does produce the same error message when using the non-existing/broken file/path, e.g. ```

sqfvm-newestdev.exe --cli-file ? '"?"' is not allowed inside of the actual file!.```

Probably caused by https://github.com/SQFvm/runtime/blob/55349de49d1c5ebeae1986cab5092829e5432b3d/src/cli/cli.cpp#L443-L446 setting the m_cli_file variable to true, calling cli_from_file in the next line and https://github.com/SQFvm/runtime/blob/55349de49d1c5ebeae1986cab5092829e5432b3d/src/cli/cli.cpp#L273-L279 erroring out when that same variable is set to true before doing anything else.