Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-35921

QUrl::StripTrailingSlash does not work with path comprised of only "/"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Not Evaluated Not Evaluated
    • None
    • 5.2.0
    • Core: I/O
    • None
    • Qt 5.2.0, Gentoo Linux, qt overlay (official/unmodified) Windows 7

      1. Create a QUrl from "http://www.facebook.com/" (Note the trailing slash)
      2. Call QUrl::adjusted(QUrl::StripTrailingSlash)

      I believe the problem is manifested in QUrl::appendPath():

      while(thePath.length() > 1 && thePath.endsWith(QLatin1Char('/')))
      thePath.chop(1);

      Whereas in Qt 4.8.5:

      while((options & StripTrailingSlash) && url.endsWith(QLatin1Char('/')))
      url.chop();

      Looks like we're stopping prematurely once we reach length 1 in the refactored code, whereas we should probably allow ourselves to remove all trailing slashes.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            thiago Thiago Macieira
            jetdog330 Dave Andrews
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes