Commit Graph

1430 Commits

Author SHA1 Message Date
Carter Li 71f68ce0c5 Android (AppLabel): reuses ffStrbufAppendUtf32CodePoint
The resource table decoder carried its own UTF-8 encoder for the strings
of a UTF-16 pool. The shared helper does the same and additionally maps a
code point outside U+10FFFF to U+FFFD instead of emitting four bytes that
are not valid UTF-8.
2026-11-04 13:29:04 +08:00
arxhr007 d697197a8b Format: fixes substring with an end index outside of the string
`{1~20,30}` printed the placeholder as is, because the `,end` part was only
checked when the start index was inside the string. `{1~20}` printed nothing.
Parse and check the whole range first, so that a valid range that lies outside
of the string gives an empty result.
2026-10-31 22:40:07 +08:00
arxhr007 d6c15e1cec Format: fixes integer wraparound when parsing numbers
Numbers that don't fit in 32 bits were truncated, so `{4294967297}` was read
as `{1}`, `{4294967296}` as the next argument, and `{$4294967297}` as the
first constant. The same applied to the start, end and length of `~`, `:`, `<`,
`>` and `|`. Clamp them instead, so that they stay out of range.

Also avoid negating INT32_MIN for the ellipsis length of `{1:-2147483648}`,
which is a signed integer overflow.
2026-10-31 22:08:40 +08:00
arxhr007 d4dd15763f Format: fixes skipping nested conditionals
When a `{?arg}` / `{/arg}` conditional is skipped, the end of the skipped part
was the next `{?}` / `{/}` in the format string, even if it closed a
conditional nested in it. The text after the nested conditional was printed
and the real closing `{?}` / `{/}` was reported as an invalid placeholder.
A literal `{{?}}` inside the skipped part also ended it.

Skip to the `{?}` / `{/}` that matches the opening one, like the printing path
already does.
2026-10-31 17:26:01 +08:00
ihsandeniz 2f68ce7f74 IO (Windows): fixes blocking forever on incomplete terminal responses
Same issue as on Unix: ffGetTerminalResponse() waits for input only before
the first ReadFile(). If the terminal answers only part of the request
(e.g. one of the two OSC 10/11 replies), the next ReadFile() blocks forever.

Wait with the same timeout before every subsequent ReadFile() as well, and
restore the console mode on that error path. While waiting, also skip
key-up records: ReadFile() returns no data for them, so one left alone in
the buffer would end the wait and the following ReadFile() would block.
2026-10-28 09:17:24 +08:00
ihsandeniz 408646df1c IO (Unix): fixes blocking forever on incomplete terminal responses
ffGetTerminalResponse() polls only before the first read(). If the terminal
sends a response that is cut short (e.g. `\e[4;800` without the rest), the
following read() in the loop blocks forever because the tty is in
non-canonical mode with VMIN=1.

Wait with the same timeout before every subsequent read() as well.
2026-10-28 09:17:24 +08:00
Don Yin ad62e3d1f5 Format: fixes substring ends before the start of the string (#2669)
* Format: fix substring ends before the start of the string

Closes #2668

Signed-off-by: Don Yin <Don_Yin@outlook.com>

* Doc: moves changelog entry to Unreleased [ci skip]

I moved the unreleased fix out of the 2.70.0 section.

Signed-off-by: Don Yin <Don_Yin@outlook.com>

---------

Signed-off-by: Don Yin <Don_Yin@outlook.com>
2026-10-26 00:34:50 -05:00
李通洲 f93ffed57a Disk: fix Windows quota affecting free space and unify disk size calculation
- Windows: use FILE_FS_FULL_SIZE_INFORMATION_EX on Windows 10 1809+ (Build >= 17763) when calcType != AVAILABLE to get ActualTotalAllocationUnits/ActualAvailableAllocationUnits (ignoring per-user disk quotas). Fall back to legacy FILE_FS_FULL_SIZE_INFORMATION with CallerAvailableAllocationUnits when calcType is AVAILABLE or EX is unavailable.
- Unix-like: respect --disk-calc-type. Use f_bfree for FREE, f_bavail for AVAILABLE (Linux/BSD/SunOS). Haiku currently always uses free_blocks.
- Refactor FFDisk: remove bytesUsed and bytesAvailable; compute used = total - free in disk module.
- Disk module: update custom format (remove `size-available`, add `bytes-used` and `bytes-total`); update JSON output (remove `bytes.available`, `bytes.used`).
- Disk detection: stop computing used in common path; let each platform set bytesFree by chosen semantics.

Fixes #2651
2026-10-13 15:35:12 +08:00
Carter Li 29567e1674 Chore: eliminates compiler warnings 2026-10-11 23:54:08 +08:00
Carter Li ab6ec4c3f5 Media (Android): adds app uid support 2026-10-11 10:42:41 +08:00
Carter Li d7b66c8677 Common (Android): unifies dex parsers 2026-10-10 23:55:38 +08:00
Carter Li 7f9faeb720 Display (Android): detects via binder 2026-10-10 22:57:48 +08:00
Carter Li cc435d2b70 Platform (OpenBSD): uses getexecpath(3) if available
Fixes https://github.com/fastfetch-cli/fastfetch/issues/2195#issuecomment-6095513342
2026-10-10 18:33:09 +08:00
Carter Li 124f474f81 Media (macOS): don't spawn child process 2026-10-10 16:32:09 +08:00
Carter Li 62617a35de Common (Debug): fixes possible errno lost 2026-10-10 15:43:20 +08:00
Carter Li de414b7250 Common (Zlib): don't #define Z_LARGE64 2026-10-10 15:41:07 +08:00
Carter Li be51ba9f15 command not found 2026-10-10 15:40:29 +08:00
Carter Li 132e69b580 Percent: clamps bar width to 0% ~ 100% 2026-10-10 14:00:30 +08:00
Carter Li 07a7211526 Command: extends useStdErr to useOutput 2026-10-10 14:00:30 +08:00
李通洲 0806145f4d Command (Windows): detects command not found error (WIP) 2026-10-10 14:00:30 +08:00
李通洲 a7e19308cc Processing (Windows): handles ERROR_PATH_NOT_FOUND 2026-10-10 14:00:30 +08:00
Carter Li 262a8ca4d3 Processing: adds more debug info 2026-10-09 23:03:20 +08:00
Carter Li 35a35f066c Android: fixes binaries built via NDK running on Termux 2026-10-07 14:29:42 +08:00
Carter Li 9859b248ff Platform: prefers the passwd shell over $SHELL 2026-10-07 14:06:56 +08:00
Carter Li 10ca4f171e Global (Android): fixes building on old API level 2026-10-07 01:45:49 +08:00
Carter Li fb89af3d84 Common: adds zlib helpers 2026-10-06 09:31:58 +08:00
Carter Li 2bcd49c106 Networking: removes unused decls 2026-10-06 01:09:14 +08:00
Carter Li 6e2a25759d Networking: removes compression support 2026-10-04 17:36:05 +08:00
Carter Li e02e44f673 Global: fixes compiling 2026-10-03 18:39:47 +08:00
Ashed 995d172d3e Global: Added Finnish support (#2633)
* Global: Added fi support

* Remove a random space i accidentally added

* Fix more spaces
2026-10-03 18:35:56 +08:00
Carter Li 8102478f2f Global: prefers gnu::cleanup 2026-10-03 18:09:17 +08:00
Carter Li 95bcc4da5b Common: adds more FF_DEBUG 2026-10-03 18:09:17 +08:00
Carter Li 1b3594f600 Global: adds more FF_DEBUG 2026-10-03 18:09:17 +08:00
Carter Li ae1288d087 Global (Windows): adds more FF_DEBUG 2026-10-03 12:29:52 +08:00
Carter Li b201fd2db9 Common: improves reliability of FF_DEBUG 2026-10-03 10:53:21 +08:00
Carter Li 3d0747b56d Common (Windows): optimises ico generation 2026-10-03 01:34:55 +08:00
Carter Li 68c5dd31f5 Global: marks ffGenerate*JsonConfig as [[gnu::cold]] 2026-10-03 01:32:02 +08:00
Carter Li ae4cbcbdba Global: removes quickjs-ng completely 2026-10-02 22:16:51 +08:00
Carter Li 4d8d6a5fe9 Brightness (Linux): removes ddcutil dep 2026-09-30 10:36:27 +08:00
Carter Li c88ec3bcc3 Android: improves performance of dex parsing 2026-09-29 23:58:44 +08:00
Carter Li 2838dccbfd Sound (Android): adds support via /dev/binder 2026-09-29 23:58:02 +08:00
Carter Li f0d8c996e6 Sound (Linux): uses raw pulseaudio protocol
Also removes libpulse dependency
2026-09-29 18:22:03 +08:00
Carter Li 4fb57bb39b Global (Windows): eliminates SHGetKnownFolderPath 2026-09-28 23:02:34 +08:00
李通洲 36dc82e926 Bootmgr: cleans code 2026-09-26 14:17:24 +08:00
李通洲 866c5e89c8 Global: fixes several issues found by AI 2026-09-25 17:28:44 +08:00
Carter Li 537635cd9c Logo: adds option logo.position: auto 2026-09-25 09:51:34 +08:00
李通洲 0e04ebdf63 Wallpaper (Android): adds support 2026-09-24 23:42:27 +08:00
李通洲 bba45429ae Global: fixes issues found by AI 2026-09-24 21:27:51 +08:00
Carter Li fb5622215b Common (Format): fixes lua error message trimming 2026-09-24 15:32:15 +08:00
李通洲 28f4f6464b Common (Windows): simplifies winrt helper 2026-09-24 10:09:02 +08:00