From kde-core-devel Tue Sep 27 10:28:19 2005 From: Andras Mantia Date: Tue, 27 Sep 2005 10:28:19 +0000 To: kde-core-devel Subject: Re: KURL problem Message-Id: <200509271328.20262.amantia () kde ! org> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=112781683605352 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--nextPart1764305.e7C9xXD4Ze" --nextPart1764305.e7C9xXD4Ze Content-Type: multipart/mixed; boundary="Boundary-01=_E7RODsmBajBDw4V" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_E7RODsmBajBDw4V Content-Type: text/plain; charset="windows-1250" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Tuesday 20 September 2005 14:02, Michael Brade wrote: > What do you suggest? Can we please fix KURL? If adjustPath() removes > *one* slash, then cleanPath() should get rid of all of them but one. > Or neither of them should change the url. Isn't the attached patch a solution (adjustPath(-1) removes all trailing=20 slashes)?. Hopefully it doesn't break existing applications (it=20 shouldn't). And it fixes the crash. Andras =2D-=20 Quanta Plus developer - http://quanta.kdewebdev.org K Desktop Environment - http://www.kde.org --Boundary-01=_E7RODsmBajBDw4V Content-Type: text/x-diff; charset="windows-1250"; name="kurl.cpp.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="kurl.cpp.diff" --- kurl.cpp.orig 2005-07-06 19:08:00.000000000 +0300 +++ kurl.cpp 2005-09-27 12:46:38.000000000 +0300 @@ -1273,8 +1273,11 @@ if ( result == "/" ) return result; int len = result.length(); - if ( (len != 0) && (result[ len - 1 ] == '/') ) - result.truncate( len - 1 ); + while (len > 1 && result[ len - 1 ] == '/') + { + len--; + } + result.truncate( len ); return result; } else { --Boundary-01=_E7RODsmBajBDw4V-- --nextPart1764305.e7C9xXD4Ze Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQBDOR7ETQdfac6L/08RAvAYAJ9YCjS5lTCA1f8nPUiRirJz3R2TAQCeNmqt Whg+X15D4gTW6t69CdYr8pU= =ug3Y -----END PGP SIGNATURE----- --nextPart1764305.e7C9xXD4Ze--