Zandronum Chat @ irc.zandronum.com
#zandronum
Get the latest version: 3.0
Source Code

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0003172Doomseeker[All Projects] Bugpublic2017-06-27 00:482018-10-27 22:55
ReporterKonda 
Assigned ToBlzut3 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformLinuxOSUbuntuOS Version10.04 x86-64
Product Version1.1 
Target Version1.2Fixed in Version1.2 
Summary0003172: Zandronum shell scripts for running test builds cause no PWADs to be loaded if the path contains spaces
DescriptionOne of the main file paths I give to Doomseeker is '/windows/Program Files (x86)/Zandronum/PWADs/'. When joining a server hosting Zandronum 3.0 alpha, after Doomseeker downloads the build, I fail to join the server because Zandronum has loaded 0 PWADs:http://i.imgur.com/7lEPko8.png [^]
When I use a different path for PWADs, like '/home/konda/Links/Zandronum/PWADs', Zandronum has files loaded normally and I can join the server that runs the beta version of Zandronum. The second path I mentioned is actually a symbolic link to the first path, which proves that the cause of the problem is within the way Doomseeker calls for the zandronum executable and is related to whether the file path contains spaces.
Steps To Reproduce1. Set up your file paths in Doomseeker so the first one that leads to your pwads directory contains spaces in its path
2. Join a Zandronum server that runs a beta build you don't have and let Doomseeker set everything up
Additional InformationWhen searching for the cause of the problem, I noticed that Doomseeker's "Join command line" actually calls a shell script instead of the Zandronum test build executable directly.
This is what the shell script looked like which Doomseeker was calling from the command line in my case:https://pastebin.com/atw34Ff0 [^]
The problem is the way the shell script passes the arguments to Zandronum. The $* shell expansion splits all command line arguments which contain spaces. The proper shell argument expansion which preserves the arguments exactly as they were passed to the script is "$@" (with the quotes). When I replace $* with "$@" everything works fine.

https://www.gnu.org/software/bash/manual/html_node/Special-Parameters.html#Special-Parameters [^]
Here it clearly states that word splitting is performed on all arguments expanded with $*, and in the case of $@: 'When the expansion occurs within double quotes, each parameter expands to a separate word. That is, "$@" is equivalent to "$1" "$2" ….'
Attached Files

- Relationships

-  Notes
User avatar (0017942)
Konda (reporter)
2017-06-27 00:54
edited on: 2017-06-27 00:56

Edit: I forgot to add that this same behavior was present in Doomseeker 1.0, from the few times I've joined a Zandronum beta server.

Additionally, you can see that /usr/bin/zandronum, which is a shell script (as installed by the zandronum package from drdteam's debian package repository), also uses the "$@" expansion and so far I've never had a single problem with passing command-line arguments to this script:
konda@mint ~ $ cat /usr/bin/zandronum
#!/bin/bash

exec /usr/games/zandronum/zandronum "$@"

User avatar (0017963)
Zalewa (developer)
2017-07-02 09:28

Fixed on Linux:https://bitbucket.org/Doomseeker/doomseeker/commits/5ac4962080d59afb4a241765eca0df57f7c32465 [^]

I suspect Mac OS X suffers the same issue, but I didn't touch that because I cannot check.
User avatar (0018679)
WubTheCaptain (developer)
2017-10-30 04:41

A little bit of off-topic chatter: I remember manually long ago in 1.1 fixing these by hand, but also other ShellCheck errors/warnings. Now that Zandronum 3.0 is out, I can't unfortunately remember what all the ShellCheck errors/warnings were about. This was one of them.
User avatar (0018736)
Blzut3 (administrator)
2017-11-03 04:30

Applied same fix to OS X.
User avatar (0019785)
WubTheCaptain (developer)
2018-09-27 02:48

"$@" with quotes is the only valid option here without ShellCheck warnings, so I believe this is resolved.

Note I didn't actually test this (setting up a Zandronum testing server takes more time than I desire to spend), but I have high confidence this patch is correct (although the code line looks a bit confusing with escaping double quotes).

"$@" is POSIX sh compliant.

Issue Community Support
This issue is already marked as resolved.
If you feel that is not the case, please reopen it and explain why.
Supporters: No one explicitly supports this issue yet.
Opponents: No one explicitly opposes this issue yet.

- Issue History
Date Modified Username Field Change
2017-06-27 00:48 Konda New Issue
2017-06-27 00:54 Konda Note Added: 0017942
2017-06-27 00:56 Konda Note Edited: 0017942 View Revisions
2017-07-02 08:41 Zalewa Assigned To => Zalewa
2017-07-02 08:41 Zalewa Status new => assigned
2017-07-02 09:28 Zalewa Note Added: 0017963
2017-07-02 09:28 Zalewa Assigned To Zalewa => Blzut3
2017-10-30 04:36 WubTheCaptain Status assigned => needs testing
2017-10-30 04:37 WubTheCaptain Status needs testing => needs review
2017-10-30 04:41 WubTheCaptain Note Added: 0018679
2017-11-03 04:30 Blzut3 Note Added: 0018736
2017-11-03 04:30 Blzut3 Status needs review => needs testing
2017-11-03 04:31 Blzut3 Fixed in Version => 1.2
2017-11-03 04:31 Blzut3 Target Version => 1.2
2018-09-27 02:48 WubTheCaptain Note Added: 0019785
2018-09-27 02:48 WubTheCaptain Status needs testing => resolved
2018-09-27 02:48 WubTheCaptain Resolution open => fixed
2018-10-27 22:55 WubTheCaptain Status resolved => closed






Questions or other issues? Contact Us.

Links


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker