Mercurial > octave
changeset 31940:7faaf2c6aaec stable
Remove trailing \r from curl dir list (bug #63851).
* liboctave/util/url-transfer.cc (curl_transfer::list): Remove potential
trailing '\r' from filenames.
author | John Donoghue <john.donoghue@ieee.org> |
---|---|
date | Fri, 24 Mar 2023 15:21:45 -0400 |
parents | 29e0d557a3be |
children | 9cd7515e735d c687e0ba6606 |
files | liboctave/util/url-transfer.cc |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/util/url-transfer.cc Mon Mar 27 13:04:03 2023 -0400 +++ b/liboctave/util/url-transfer.cc Fri Mar 24 15:21:45 2023 -0400 @@ -539,7 +539,12 @@ if (newpos == std::string::npos) break; - retval(i) = str.substr(pos, newpos - pos); + std::string name = str.substr (pos, newpos - pos); + // remove trailing \r if there is one + if (name.length () > 0 && name.back () == '\r') + name.pop_back (); + + retval(i) = name; pos = newpos + 1; }