Deprecate quoteIfContainsWhite in favor of osproc.quoteShell.

This commit is contained in:
Michał Zieliński 2013-12-10 23:00:01 +01:00
commit c363197275

View file

@ -709,9 +709,11 @@ proc rfind*(s, sub: string, start: int = -1): int {.noSideEffect.} =
if result != -1: return if result != -1: return
return -1 return -1
proc quoteIfContainsWhite*(s: string): string = proc quoteIfContainsWhite*(s: string): string {.deprecated.} =
## returns ``'"' & s & '"'`` if `s` contains a space and does not ## returns ``'"' & s & '"'`` if `s` contains a space and does not
## start with a quote, else returns `s` ## start with a quote, else returns `s`
## DEPRECATED as it was confused for shell quoting function.
## For this application use osproc.quoteShell.
if find(s, {' ', '\t'}) >= 0 and s[0] != '"': if find(s, {' ', '\t'}) >= 0 and s[0] != '"':
result = '"' & s & '"' result = '"' & s & '"'
else: else: