Fix rsync progress parsing in locales that use comma in number display. Closes: #744148

This commit is contained in:
Joey Hess 2014-04-10 15:36:51 -04:00
parent aba17a402e
commit a6df4698a3
2 changed files with 6 additions and 1 deletions

View file

@ -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. -}