# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1575258549 0 # Node ID cfa0a9554118b8481c59246dcf72c8537408e127 # Parent a3fbe505307a3877f2ee3f44fc04b2dc502cfee6 Win: Edge (Chromium) HTML_RESULT returns a quoted result which needs to be removed. This removes the concern about an expected "null" return, since that is not quoted. diff -r a3fbe505307a -r cfa0a9554118 win/edge.cpp --- a/win/edge.cpp Sat Nov 30 23:07:09 2019 +0000 +++ b/win/edge.cpp Mon Dec 02 03:49:09 2019 +0000 @@ -293,9 +293,23 @@ Callback( [thishwnd, scriptdata](HRESULT error, PCWSTR result) -> HRESULT { + char *scriptresult; + + /* Result is unquoted "null" when we should return NULL */ if (result && _wcsicmp(result, L"null") == 0) - result = NULL; - void *params[2] = { (void *)(result ? WideToUTF8((LPWSTR)result) : NULL), DW_INT_TO_POINTER((error == S_OK ? DW_ERROR_NONE : DW_ERROR_UNKNOWN)) }; + scriptresult = NULL; + else + scriptresult = result ? WideToUTF8((LPWSTR)result) : NULL; + + /* String results are enclosed in quotations, remove the quotes */ + if(scriptresult && *scriptresult == '\"') + { + char *end = strrchr(scriptresult, '\"'); + if(end) + *end = '\0'; + scriptresult++; + } + void *params[2] = { (void *)scriptresult, DW_INT_TO_POINTER((error == S_OK ? DW_ERROR_NONE : DW_ERROR_UNKNOWN)) }; _wndproc(thishwnd, WM_USER + 100, (WPARAM)params, (LPARAM)scriptdata); return S_OK; }).Get());