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

QMimeDatabase: File with "diff" followed by tab character is not recognized as text/x-diff

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.4.2
    • 5.4.1
    • Core: Other
    • None
    • 416438c2f35dc774e4c52a705c5a7098a69647fc

    Description

      #include <QBuffer>
      #include <QMimeDatabase>
      #include <QDebug>
      
      int main(int argc, char *argv[])
      {
          static const char data[] = "diff\t";
          QByteArray d(data);
          QBuffer buff(&d);
          QMimeDatabase mdb;
          qDebug() << mdb.mimeTypeForFileNameAndData(QLatin1String("blah"), &buff).name();
      
          return 0;
      }
      

      is supposed to output text/x-patch, but detects as plain/text.

      Attachments

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

        Activity

          People

            con Eike Ziller
            con Eike Ziller
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes