Skip to content

Commit c2d0a57

Browse files
committed
Merge branch 'dev' into release
2 parents 09b3db0 + 237ca45 commit c2d0a57

File tree

18 files changed

+65
-79
lines changed

18 files changed

+65
-79
lines changed

CMakeLists.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@
1818
cmake_minimum_required (VERSION 3.10)
1919

2020
project (Lagrange
21-
VERSION 1.18.6
21+
VERSION 1.18.7
2222
DESCRIPTION "A Beautiful Gemini Client"
2323
LANGUAGES C
2424
)
2525
set (COPYRIGHT_YEAR 2025)
2626
if (IOS)
2727
set (PROJECT_VERSION 1.18)
28-
set (IOS_BUNDLE_VERSION 10)
29-
set (IOS_BUILD_DATE "2025-06-04")
28+
set (IOS_BUNDLE_VERSION 11)
29+
set (IOS_BUILD_DATE "2025-08-07")
3030
endif ()
3131
if (ANDROID)
3232
set (PROJECT_VERSION 1.18)
33-
set (ANDROID_BUILD_VERSION b35) # remember to update Gradle, AndroidManifest.xml
34-
set (ANDROID_BUILD_DATE "2024-12-10")
33+
set (ANDROID_BUILD_VERSION b37) # remember to update Gradle, AndroidManifest.xml
34+
set (ANDROID_BUILD_DATE "2025-08-07")
3535
endif ()
3636

3737
# Load modules from the source tree
@@ -501,7 +501,7 @@ if (ENABLE_GUI)
501501
if (TARGET harfbuzz-lib)
502502
target_link_libraries (app PUBLIC harfbuzz-lib)
503503
else ()
504-
target_link_libraries (app PUBLIC ${HARFBUZZ_LIBRARIES})
504+
target_link_libraries (app PUBLIC ${HARFBUZZ_LDFLAGS})
505505
target_include_directories (app PUBLIC ${HARFBUZZ_INCLUDE_DIRS})
506506
endif ()
507507
target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_HARFBUZZ=1)
@@ -510,7 +510,7 @@ if (ENABLE_GUI)
510510
if (TARGET fribidi-lib)
511511
target_link_libraries (app PUBLIC fribidi-lib)
512512
else ()
513-
target_link_libraries (app PUBLIC ${FRIBIDI_LIBRARIES})
513+
target_link_libraries (app PUBLIC ${FRIBIDI_LDFLAGS})
514514
target_include_directories (app PUBLIC ${FRIBIDI_INCLUDE_DIRS})
515515
endif ()
516516
target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_FRIBIDI=1)

cmake/Depends.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ if (ENABLE_FRIBIDI)
161161
"GNU FriBidi must be built with Meson. Please install Meson and Ninja and try again, or provide FriBidi via pkg-config.")
162162
endif ()
163163
add_library (fribidi-lib INTERFACE)
164-
target_include_directories (fribidi-lib INTERFACE ${_dst}/include)
164+
target_include_directories (fribidi-lib INTERFACE ${_dst}/include/fribidi)
165165
target_link_libraries (fribidi-lib INTERFACE ${_dst}/lib/libfribidi.a)
166166
target_compile_definitions (fribidi-lib INTERFACE FRIBIDI_LIB_STATIC=1)
167167
set (FRIBIDI_FOUND YES)

res/about/android-version.gmi

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@
66
```
77
# Release notes
88

9+
## 1.18 (Beta 37)
10+
* Added Samogitian UI language.
11+
* Link icons are now included in the clickable part of a line.
12+
* Revised handling of reserved URI characters according to RFC 3986. The previous behavior did not fully conform to the standard.
13+
* Updated UI translations.
14+
15+
## 1.18 (Beta 36)
16+
* Added "Copy Page URL" to the toolbar menu.
17+
* Fixed a potential crash when browsing to a bookmarked page due to inadvertent ID number overflow. (Courtesy of @cthulhu.)
18+
* Erase possible link icon leftovers after toggling link numbering.
19+
* Fixed hang when encountering the U+FDFD character.
20+
* Fixed layout issue with empty list widgets (focus border only partially visible).
21+
* Updated UI translations.
22+
923
## 1.18 (Beta 35)
1024
* Added option to disable page width expansion to fit long lines.
1125
* Limited page width expansion to 33% so room is left for the current title in the margin.

res/about/ios-version.gmi

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
```
77
# Release notes
88

9+
## 1.18 (11)
10+
* Link icons are now included in the clickable part of a line.
11+
* Revised handling of reserved URI characters according to RFC 3986. The previous behavior did not fully conform to the standard.
12+
* Updated UI translations.
13+
914
## 1.18 (10)
1015
* Added Samogitian UI language.
1116
* Updated UI translations.

res/about/version.gmi

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
```
77
# Release notes
88

9+
## 1.18.7
10+
* Revised handling of reserved URI characters according to RFC 3986. The previous behavior did not fully conform to the standard.
11+
* Fixed opening some WebP images. There was a problem checking for the "image/webp" media type.
12+
* Fixed removal of unexpected NUL characters from the source text.
13+
* Fixed redundant mouse events when receiving touch events on the desktop.
14+
915
## 1.18.6
1016
* Added Samogitian (sgs) UI translation.
1117
* Link icons are now included in the clickable part of a line.

src/app.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1687,8 +1687,8 @@ const iString *debugInfo_App(void) {
16871687
iObjectList *docs = iClob(listDocuments_App(NULL));
16881688
format_String(msg, "# Debug information\n");
16891689
if (isDesktop_Platform()) {
1690-
appendFormat_String(msg, "Executable path: %s\n", cstr_String(execPath_App()));
1691-
appendFormat_String(msg, "User directory: %s\n", cstr_String(dataDir_App()));
1690+
appendFormat_String(msg, "\n## User directory\n%s\n", cstr_String(dataDir_App()));
1691+
appendFormat_String(msg, "\n## Executable path\n%s\n", cstr_String(execPath_App()));
16921692
}
16931693
appendFormat_String(msg, "\n## Memory usage\n"); {
16941694
iMemInfo total = { 0, 0 };
@@ -2218,7 +2218,7 @@ void processEvents_App(enum iAppEventMode eventMode) {
22182218
break;
22192219
}
22202220
window->lastHover = window->hover;
2221-
/* When clicking a mouse button, we need to be able to close previously
2221+
/* When clicking a mouse button, we need to be able to close previously
22222222
existing popup windows. However, after the event has been processed,
22232223
a new popup menu may have just opened, so we first take a copy
22242224
of the existing list of popups. */
@@ -2234,7 +2234,7 @@ void processEvents_App(enum iAppEventMode eventMode) {
22342234
iRoot *popRoot = pop->roots[0];
22352235
if (popRoot && !isRecentlyDeleted_Widget(popRoot->widget)) {
22362236
postCommandf_Root(popRoot, "menu.cancel");
2237-
}
2237+
}
22382238
}
22392239
}
22402240
break;

src/gmdocument.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2511,7 +2511,7 @@ static void import_GmDocument_(iGmDocument *d) {
25112511
if (*ch == 0) {
25122512
remove_Block(&d->source.chars, pos, 1);
25132513
pos--;
2514-
ch--;
2514+
ch = constBegin_String(&d->source) + pos;
25152515
}
25162516
}
25172517
}

src/gmrequest.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ void setUrl_GmRequest(iGmRequest *d, const iString *url) {
779779
characters? Could be a server-side issue, e.g., if they're using a URL parser meant for
780780
the web. */
781781
/* Encode everything except already-percent encoded characters. */
782-
iString *enc = urlEncodeExclude_String(&d->url, "%" URL_RESERVED_CHARS);
782+
iString *enc = urlEncodeExclude_String(&d->url, URL_ENCODE_EXCLUDE_CHARS);
783783
/* Normalize empty paths to /. */ {
784784
iUrl parts;
785785
init_Url(&parts, enc);
@@ -1253,8 +1253,12 @@ void submit_GmRequest(iGmRequest *d) {
12531253
}
12541254
else {
12551255
/* Normal Gemini request. */
1256-
setContent_TlsRequest(d->req,
1257-
utf8_String(collectNewFormat_String("%s\r\n", cstr_String(&d->url))));
1256+
iString content;
1257+
init_String(&content);
1258+
format_String(&content, "%s\r\n", cstr_String(&d->url));
1259+
truncate_Block(&content.chars, 1024 /* maximum permitted URI length */ + 2 /* \r\n */);
1260+
setContent_TlsRequest(d->req, utf8_String(&content));
1261+
deinit_String(&content);
12581262
}
12591263
submit_TlsRequest(d->req);
12601264
}

src/gmutil.c

Lines changed: 5 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -343,45 +343,6 @@ static iString *punyDecodeHost_(iRangecc host) {
343343
return result;
344344
}
345345

346-
void urlDecodePath_String(iString *d) {
347-
iUrl url;
348-
init_Url(&url, d);
349-
if (isEmpty_Range(&url.path)) {
350-
return;
351-
}
352-
iString *decoded = new_String();
353-
appendRange_String(decoded, (iRangecc){ constBegin_String(d), url.path.start });
354-
iString *path = newRange_String(url.path);
355-
iString *decPath = urlDecodeExclude_String(path, ":;%?/#"); /* don't decode reserved path chars */
356-
append_String(decoded, decPath);
357-
delete_String(decPath);
358-
delete_String(path);
359-
appendRange_String(decoded, (iRangecc){ url.path.end, constEnd_String(d) });
360-
set_String(d, decoded);
361-
delete_String(decoded);
362-
}
363-
364-
void urlEncodePath_String(iString *d) {
365-
iUrl url;
366-
init_Url(&url, d);
367-
if (equalCase_Rangecc(url.scheme, "data")) {
368-
return;
369-
}
370-
if (isEmpty_Range(&url.path)) {
371-
return;
372-
}
373-
iString *encoded = new_String();
374-
appendRange_String(encoded, (iRangecc){ constBegin_String(d), url.path.start });
375-
iString *path = newRange_String(url.path);
376-
iString *encPath = urlEncodeExclude_String(path, "%/= ");
377-
append_String(encoded, encPath);
378-
delete_String(encPath);
379-
delete_String(path);
380-
appendRange_String(encoded, (iRangecc){ url.path.end, constEnd_String(d) });
381-
set_String(d, encoded);
382-
delete_String(encoded);
383-
}
384-
385346
iString *withUrlParameters_String(const iString *d, ...) {
386347
iUrl url;
387348
init_Url(&url, d);
@@ -745,21 +706,23 @@ const iString *canonicalUrl_String(const iString *d) {
745706
iString *canon = NULL;
746707
iUrl parts;
747708
init_Url(&parts, d);
709+
#if 0
748710
/* Colons (0x3a) are in decoded form in the URL path. */
749711
if (iStrStrN(parts.path.start, "%3A", size_Range(&parts.path)) ||
750712
iStrStrN(parts.path.start, "%3a", size_Range(&parts.path))) {
751713
/* This is done separately to avoid the copy if %3A is not present; it's rare. */
752714
canon = copy_String(d);
753-
urlDecodePath_String(canon);
715+
/*urlDecodePath_String(canon);*/
754716
iString *dec = maybeUrlDecodeExclude_String(canon, "% " URL_RESERVED_CHARS); /* decode everything else in all parts */
755717
if (dec) {
756718
set_String(canon, dec);
757719
delete_String(dec);
758720
}
759721
}
760722
else {
761-
canon = maybeUrlDecodeExclude_String(d, "% " URL_RESERVED_CHARS);
762-
}
723+
#endif
724+
canon = maybeUrlDecodeExclude_String(d, " " URL_DECODE_EXCLUDE_CHARS);
725+
// }
763726
/* `canon` may now be NULL if nothing was decoded. */
764727
if (indexOfCStr_String(canon ? canon : d, " ") != iInvalidPos ||
765728
indexOfCStr_String(canon ? canon : d, "\n") != iInvalidPos) {

src/gmutil.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ iRegExp * newGemtextLink_RegExp (void);
106106
#define GEMINI_DEFAULT_PORT_CSTR "1965"
107107
#define MISFIN_DEFAULT_PORT ((uint16_t) 1958)
108108
#define URL_RESERVED_CHARS ":/?#[]@!$&'()*+,;=" /* RFC 3986 */
109+
#define URL_DECODE_EXCLUDE_CHARS URL_RESERVED_CHARS "%\""
110+
#define URL_ENCODE_EXCLUDE_CHARS URL_RESERVED_CHARS "%"
109111

110112
struct Impl_Url {
111113
iRangecc scheme;
@@ -141,8 +143,6 @@ void stripUrlPort_String (iString *);
141143
void stripDefaultUrlPort_String(iString *);
142144
const iString * urlFragmentStripped_String(const iString *);
143145
const iString * urlQueryStripped_String (const iString *);
144-
void urlDecodePath_String (iString *);
145-
void urlEncodePath_String (iString *);
146146
iString * withUrlParameters_String(const iString *d, ... /* key, value */); /* NULL key terminates; value can be NULL */
147147
void urlEncodeQuery_String (iString *);
148148
iString * makeFileUrl_String (const iString *localFilePath);

0 commit comments

Comments
 (0)