summaryrefslogtreecommitdiff
path: root/xmake/core/base/string.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/core/base/string.lua')
-rw-r--r--xmake/core/base/string.lua4
1 files changed, 1 insertions, 3 deletions
diff --git a/xmake/core/base/string.lua b/xmake/core/base/string.lua
index 13ca6c1fb..558344d7f 100644
--- a/xmake/core/base/string.lua
+++ b/xmake/core/base/string.lua
@@ -200,9 +200,7 @@ end
-- trim the right spaces
function string:rtrim()
- local n = #self
- while n > 0 and s:find("^%s", n) do n = n - 1 end
- return self:sub(1, n)
+ return (self:gsub("%s*$", ""))
end
-- encode: ' ', '=', '\"', '<'