⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 268911 in webkit


Ignore:
Timestamp:
Oct 23, 2020, 1:25:34 AM (6 years ago)
Author:
Carlos Garcia Campos
Message:

Merge r267789 - [GTK] Chassis type check fails if the value is quoted
https://bugs.webkit.org/show_bug.cgi?id=217123

Patch by Alexander Mikhaylenko <Alexander Mikhaylenko> on 2020-09-30
Reviewed by Carlos Garcia Campos.

Sometimes the chassis type can be quoted, in this case we'll fail to
parse it and fall back to desktop type. Unquote the string before
attempting to parse it.

  • wtf/glib/ChassisType.cpp:

(WTF::readMachineInfoChassisType):

Location:
releases/WebKitGTK/webkit-2.30/Source/WTF
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • releases/WebKitGTK/webkit-2.30/Source/WTF/ChangeLog

    r266590 r268911  
     12020-09-30  Alexander Mikhaylenko  <alexm@gnome.org>
     2
     3        [GTK] Chassis type check fails if the value is quoted
     4        https://bugs.webkit.org/show_bug.cgi?id=217123
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        Sometimes the chassis type can be quoted, in this case we'll fail to
     9        parse it and fall back to desktop type. Unquote the string before
     10        attempting to parse it.
     11
     12        * wtf/glib/ChassisType.cpp:
     13        (WTF::readMachineInfoChassisType):
     14
    1152020-09-01  Carlos Garcia Campos  <cgarcia@igalia.com>
    216
  • releases/WebKitGTK/webkit-2.30/Source/WTF/wtf/glib/ChassisType.cpp

    r264213 r268911  
    4747        if (g_str_has_prefix(split.get()[i], "CHASSIS=")) {
    4848            char* chassis = split.get()[i] + 8;
    49             if (!strcmp(chassis, "tablet") || !strcmp(chassis, "handset"))
     49
     50            GUniquePtr<char> unquoted(g_shell_unquote(chassis, &error.outPtr()));
     51            if (error)
     52                g_warning("Could not unquote chassis type %s: %s", chassis, error->message);
     53
     54            if (!strcmp(unquoted.get(), "tablet") || !strcmp(unquoted.get(), "handset"))
    5055                return ChassisType::Mobile;
    5156
Note: See TracChangeset for help on using the changeset viewer.