EMSUSD-3783 properly quote file paths in interpreted commands - #4684
Conversation
- Added `quoteForCommand`, `quoteLayerIdentifierForCommand` and `quoteFilePathForCommand` helper functions. - Some may seem unnecessary now, just making the code intention clearer and having possible future point for fixing other quoting problem we may find. - Using these quotation functions when creating commands for MEL.
| cmd += " "; | ||
| cmd += quote(layer->GetIdentifier()); | ||
| cmd += " "; | ||
| cmd += quoteForCommand(proxyShape); |
There was a problem hiding this comment.
Don't we need cmd += " "; after this line and line 298 similar to the old code? I don't see quoteForCommand adding a space after its command.
There was a problem hiding this comment.
Every "quote" function adds a prefix space, so we don't need to add extra spaces.
There was a problem hiding this comment.
all except -stichLayers
There was a problem hiding this comment.
ie in the for loop that's on line 288 the cmd -stichLayers is being added without a space, and the quote command isn't adding a space at the end.
End of iter 1: ... "proxy" "id1"
Iter 2 starts with cmd += "-stitchLayers "; → ... "id1"-stitchLayers
There was a problem hiding this comment.
Yeah, that one the original code put teh space AFTER stitchLayer and I missed it, good catch.
quoteForCommand,quoteLayerIdentifierForCommandandquoteFilePathForCommandhelper functions.