Title: [268911] releases/WebKitGTK/webkit-2.30/Source/WTF
Revision
268911
Author
[email protected]
Date
2020-10-23 01:25:34 -0700 (Fri, 23 Oct 2020)

Log 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 <[email protected]> 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):

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.30/Source/WTF/ChangeLog (268910 => 268911)


--- releases/WebKitGTK/webkit-2.30/Source/WTF/ChangeLog	2020-10-23 08:25:31 UTC (rev 268910)
+++ releases/WebKitGTK/webkit-2.30/Source/WTF/ChangeLog	2020-10-23 08:25:34 UTC (rev 268911)
@@ -1,3 +1,17 @@
+2020-09-30  Alexander Mikhaylenko  <[email protected]>
+
+        [GTK] Chassis type check fails if the value is quoted
+        https://bugs.webkit.org/show_bug.cgi?id=217123
+
+        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):
+
 2020-09-01  Carlos Garcia Campos  <[email protected]>
 
         [Linux] Web Inspector: show per thread cpu usage

Modified: releases/WebKitGTK/webkit-2.30/Source/WTF/wtf/glib/ChassisType.cpp (268910 => 268911)


--- releases/WebKitGTK/webkit-2.30/Source/WTF/wtf/glib/ChassisType.cpp	2020-10-23 08:25:31 UTC (rev 268910)
+++ releases/WebKitGTK/webkit-2.30/Source/WTF/wtf/glib/ChassisType.cpp	2020-10-23 08:25:34 UTC (rev 268911)
@@ -46,7 +46,12 @@
     for (int i = 0; split.get()[i]; ++i) {
         if (g_str_has_prefix(split.get()[i], "CHASSIS=")) {
             char* chassis = split.get()[i] + 8;
-            if (!strcmp(chassis, "tablet") || !strcmp(chassis, "handset"))
+
+            GUniquePtr<char> unquoted(g_shell_unquote(chassis, &error.outPtr()));
+            if (error)
+                g_warning("Could not unquote chassis type %s: %s", chassis, error->message);
+
+            if (!strcmp(unquoted.get(), "tablet") || !strcmp(unquoted.get(), "handset"))
                 return ChassisType::Mobile;
 
             return ChassisType::Desktop;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to