From bfd88e715206691f058b4877560cc75459910ee4 Mon Sep 17 00:00:00 2001 From: Marcus Shaw <189466376+marcshawco@users.noreply.github.com> Date: Sat, 14 Nov 2026 21:49:24 -0800 Subject: [PATCH] Keep two-clause DXMT_CONFIG defaults, quote the Dobby source path is_setting_value refused ';', so a default DXMT_CONFIG holding both an upscale factor and a frame cap was dropped on its way to the page. gatecheck now covers that case. make dobby passed the source path to cmake unquoted, which failed for a checkout in a path with spaces. Co-Authored-By: Claude Opus 5.5 --- Makefile | 2 +- dylib/feats/webpatch.c | 4 +++- dylib/tests/gatecheck.c | 6 ++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 14db835f..86d706de 100644 --- a/Makefile +++ b/Makefile @@ -643,7 +643,7 @@ helpers-install: $(ICONMAKER) $(APPINFO) dobby: @mkdir -p $(DOBBY_DIR) - cd $(DOBBY_DIR) && cmake $(CURDIR)/vendor/dobby \ + cd $(DOBBY_DIR) && cmake "$(CURDIR)/vendor/dobby" \ -DCMAKE_OSX_ARCHITECTURES=arm64 \ -DCMAKE_OSX_DEPLOYMENT_TARGET=$(MIN_VER) \ -DDOBBY_DEBUG=OFF \ diff --git a/dylib/feats/webpatch.c b/dylib/feats/webpatch.c index 6ae81d9d..b5926dbc 100644 --- a/dylib/feats/webpatch.c +++ b/dylib/feats/webpatch.c @@ -176,8 +176,10 @@ static int is_setting_key(const char *str, size_t n) { } static int is_setting_value(const char *str, size_t n) { + // ';' joins DXMT_CONFIG's clauses. It is safe inside the JS string this lands in. for (size_t i = 0; i < n; i++) - if (!is_ident_char((unsigned char)str[i]) && str[i] != '.' && str[i] != '=') return 0; + if (!is_ident_char((unsigned char)str[i]) && str[i] != '.' && str[i] != '=' + && str[i] != ';') return 0; return 1; } diff --git a/dylib/tests/gatecheck.c b/dylib/tests/gatecheck.c index 4d53b1d0..642eee1a 100644 --- a/dylib/tests/gatecheck.c +++ b/dylib/tests/gatecheck.c @@ -113,6 +113,12 @@ static void check_defaults(void) { "\"DXMT_CONFIG\":\"d3d11.metalSpatialUpscaleFactor=1.5\"}," "fex:{\"MTL_HUD_ENABLED\":\"0\"}}") != 0) wrong("the defaults are %s", marker_text(NP_DEFAULTS[0])); + // Frame cap and upscale factor together, which the panel writes as one value. + np_webpatch_set_defaults("DXMT_CONFIG=d3d11.metalSpatialUpscaleFactor=1.5;d3d11.preferredMaxFrameRate=60", ""); + if (strcmp(marker_text(NP_DEFAULTS[0]), "{rosetta:{\"DXMT_CONFIG\":" + "\"d3d11.metalSpatialUpscaleFactor=1.5;d3d11.preferredMaxFrameRate=60\"}," + "fex:{}}") != 0) + wrong("a DXMT_CONFIG with two clauses gives %s", marker_text(NP_DEFAULTS[0])); np_webpatch_set_defaults("FOO=\"});alert(1);({\nwinemsync=1\nWINEMSYNC=1\nNOEQUALS\n=1", ""); if (strcmp(marker_text(NP_DEFAULTS[0]), "{rosetta:{\"WINEMSYNC\":\"1\"},fex:{}}") != 0) wrong("lines the page cannot take give %s", marker_text(NP_DEFAULTS[0]));