From c6513581b19a020577cf170aa3299db2ed2f2317 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Tue, 7 Dec 2021 14:02:00 +0200 Subject: DocumentWidget: Don't trim space if user entered only spaces --- src/ui/documentwidget.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index d5ab5704..c4d7c56a 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c @@ -2096,7 +2096,10 @@ static iString *makeQueryUrl_DocumentWidget_(const iDocumentWidget *d, appendCStr_String(url, "?"); iString *cleaned = copy_String(userEnteredText); if (deviceType_App() != desktop_AppDeviceType) { - trim_String(cleaned); /* autocorrect may insert an extra space */ + trimEnd_String(cleaned); /* autocorrect may insert an extra space */ + if (isEmpty_String(cleaned)) { + set_String(cleaned, userEnteredText); /* user wanted just spaces? */ + } } append_String(url, collect_String(urlEncode_String(cleaned))); delete_String(cleaned); -- cgit v1.2.3