diff options
author | Joey Hess <joey@kitenet.net> | 2014-04-10 15:36:51 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-04-10 15:36:51 -0400 |
commit | 1bdf98e0eecc93973e6bc064643edd5993138f24 (patch) | |
tree | b014608b7884393efb53d957c8eeb82dd87427c3 /Utility | |
parent | e5b6f5b5f69ed5a76802e664c74870bc99f065e8 (diff) |
Fix rsync progress parsing in locales that use comma in number display. Closes: #744148
Diffstat (limited to 'Utility')
-rw-r--r-- | Utility/Rsync.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Utility/Rsync.hs b/Utility/Rsync.hs index 2c5e39b6e..82166f645 100644 --- a/Utility/Rsync.hs +++ b/Utility/Rsync.hs @@ -124,6 +124,9 @@ rsyncUrlIsPath s - after the \r is the number of bytes processed. After the number, - there must appear some whitespace, or we didn't get the whole number, - and return the \r and part we did get, for later processing. + - + - In some locales, the number will have one or more commas in the middle + - of it. -} parseRsyncProgress :: String -> (Maybe Integer, String) parseRsyncProgress = go [] . reverse . progresschunks @@ -142,7 +145,7 @@ parseRsyncProgress = go [] . reverse . progresschunks parsebytes s = case break isSpace s of ([], _) -> Nothing (_, []) -> Nothing - (b, _) -> readish b + (b, _) -> readish $ filter (/= ',') b {- Filters options to those that are safe to pass to rsync in server mode, - without causing it to eg, expose files. -} |