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

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

    XMLWordPrintable

Details

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

    Description

      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.

      Attachments

        Issue Links

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

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes