Compare commits

..

1 Commits

Author SHA1 Message Date
dependabot[bot] b615093ab0 CI: Bump the github-actions group across 1 directory with 4 updates
Bumps the github-actions group with 4 updates in the / directory: [actions/upload-artifact](https://github.com/actions/upload-artifact), [actions/download-artifact](https://github.com/actions/download-artifact), [github/codeql-action/init](https://github.com/github/codeql-action) and [github/codeql-action/analyze](https://github.com/github/codeql-action).


Updates `actions/upload-artifact` from 7.0.1 to 7.0.2
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/043fb46d1a93c77aae656e7c1c64a875d1fc6a0a...cf430e030ddbb5b0abf93d22962f4752f3646cd9)

Updates `actions/download-artifact` from 8.0.1 to 8.0.2
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c...9000827ccba6bdab643e8b6fd33ac0654aef8333)

Updates `github/codeql-action/init` from 4.38.2 to 4.39.0
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2...6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee)

Updates `github/codeql-action/analyze` from 4.38.2 to 4.39.0
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2...6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: 8.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/codeql-action/analyze
  dependency-version: 4.38.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/codeql-action/init
  dependency-version: 4.38.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-10-25 18:07:01 +00:00
24 changed files with 73 additions and 110 deletions
+1 -1
View File
@@ -157,7 +157,7 @@ jobs:
ls -l fastfetch ls -l fastfetch
- name: upload artifacts - name: upload artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with: with:
name: fastfetch-android-${{ inputs.abi }} name: fastfetch-android-${{ inputs.abi }}
path: ./fastfetch-*.* path: ./fastfetch-*.*
+1 -1
View File
@@ -17,7 +17,7 @@ jobs:
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: download benchmark data - name: download benchmark data
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with: with:
pattern: benchmark-* pattern: benchmark-*
path: benchmarks path: benchmarks
+1 -1
View File
@@ -60,7 +60,7 @@ jobs:
run: ctest --output-on-failure run: ctest --output-on-failure
- name: upload artifacts - name: upload artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with: with:
name: fastfetch-dragonfly-amd64 name: fastfetch-dragonfly-amd64
path: ./fastfetch-*.* path: ./fastfetch-*.*
+1 -1
View File
@@ -61,7 +61,7 @@ jobs:
run: ctest --output-on-failure run: ctest --output-on-failure
- name: upload artifacts - name: upload artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with: with:
name: fastfetch-freebsd-amd64 name: fastfetch-freebsd-amd64
path: ./fastfetch-*.* path: ./fastfetch-*.*
+1 -1
View File
@@ -53,7 +53,7 @@ jobs:
run: ctest --output-on-failure run: ctest --output-on-failure
- name: upload artifacts - name: upload artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with: with:
name: fastfetch-haiku-amd64 name: fastfetch-haiku-amd64
path: ./fastfetch-*.* path: ./fastfetch-*.*
+1 -1
View File
@@ -41,7 +41,7 @@ jobs:
ctest --output-on-failure ctest --output-on-failure
- name: upload artifacts - name: upload artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with: with:
name: fastfetch-linux-armv7l name: fastfetch-linux-armv7l
path: ./fastfetch-*.* path: ./fastfetch-*.*
+4 -4
View File
@@ -52,7 +52,7 @@ jobs:
- name: Initialize CodeQL - name: Initialize CodeQL
if: inputs.arch == 'amd64' if: inputs.arch == 'amd64'
uses: github/codeql-action/init@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2 uses: github/codeql-action/init@6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee # v4.39.0
with: with:
languages: c languages: c
@@ -64,7 +64,7 @@ jobs:
- name: perform CodeQL analysis - name: perform CodeQL analysis
if: inputs.arch == 'amd64' if: inputs.arch == 'amd64'
uses: github/codeql-action/analyze@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2 uses: github/codeql-action/analyze@6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee # v4.39.0
- name: list features - name: list features
run: ./fastfetch --list-features run: ./fastfetch --list-features
@@ -123,13 +123,13 @@ jobs:
cpack -V cpack -V
- name: upload artifacts - name: upload artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with: with:
name: fastfetch-linux-${{ inputs.arch }} name: fastfetch-linux-${{ inputs.arch }}
path: ./fastfetch-*.* path: ./fastfetch-*.*
- name: upload benchmark data - name: upload benchmark data
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with: with:
name: benchmark-linux-${{ inputs.arch }} name: benchmark-linux-${{ inputs.arch }}
path: benchmark.json path: benchmark.json
+1 -1
View File
@@ -67,7 +67,7 @@ jobs:
run: ctest --output-on-failure run: ctest --output-on-failure
- name: upload artifacts - name: upload artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with: with:
name: fastfetch-linux-i686 name: fastfetch-linux-i686
path: ./fastfetch-*.* path: ./fastfetch-*.*
+1 -1
View File
@@ -54,7 +54,7 @@ jobs:
' '
- name: upload artifacts - name: upload artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with: with:
name: fastfetch-linux-loong64 name: fastfetch-linux-loong64
path: ./fastfetch-*.* path: ./fastfetch-*.*
+1 -1
View File
@@ -42,7 +42,7 @@ jobs:
ctest --output-on-failure ctest --output-on-failure
- name: upload artifacts - name: upload artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with: with:
name: fastfetch-linux-${{ inputs.arch }} name: fastfetch-linux-${{ inputs.arch }}
path: ./fastfetch-*.* path: ./fastfetch-*.*
+2 -2
View File
@@ -74,13 +74,13 @@ jobs:
run: ctest --output-on-failure run: ctest --output-on-failure
- name: upload artifacts - name: upload artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with: with:
name: fastfetch-macos-universal name: fastfetch-macos-universal
path: ./fastfetch-*.* path: ./fastfetch-*.*
- name: upload benchmark data - name: upload benchmark data
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with: with:
name: benchmark-macos-universal name: benchmark-macos-universal
path: benchmark.json path: benchmark.json
+1 -1
View File
@@ -44,7 +44,7 @@ jobs:
shell: alpine.sh {0} shell: alpine.sh {0}
- name: upload artifacts - name: upload artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with: with:
name: fastfetch-musl-amd64 name: fastfetch-musl-amd64
path: ./fastfetch-*.* path: ./fastfetch-*.*
+1 -1
View File
@@ -59,7 +59,7 @@ jobs:
run: ctest --output-on-failure run: ctest --output-on-failure
- name: upload artifacts - name: upload artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with: with:
name: fastfetch-netbsd-amd64 name: fastfetch-netbsd-amd64
path: ./fastfetch-*.* path: ./fastfetch-*.*
+1 -1
View File
@@ -64,7 +64,7 @@ jobs:
cpack -V cpack -V
- name: upload artifacts - name: upload artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with: with:
name: fastfetch-omnios-amd64 name: fastfetch-omnios-amd64
path: ./fastfetch-*.* path: ./fastfetch-*.*
+1 -1
View File
@@ -59,7 +59,7 @@ jobs:
run: ctest --output-on-failure run: ctest --output-on-failure
- name: upload artifacts - name: upload artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with: with:
name: fastfetch-openbsd-amd64 name: fastfetch-openbsd-amd64
path: ./fastfetch-*.* path: ./fastfetch-*.*
+1 -1
View File
@@ -22,7 +22,7 @@ jobs:
- name: download artifacts - name: download artifacts
if: inputs.ffversion != steps.get_version_release.outputs.release if: inputs.ffversion != steps.get_version_release.outputs.release
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
- name: create release - name: create release
if: inputs.ffversion != steps.get_version_release.outputs.release if: inputs.ffversion != steps.get_version_release.outputs.release
+1 -1
View File
@@ -40,7 +40,7 @@ jobs:
cpack -V cpack -V
- name: upload artifacts - name: upload artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with: with:
name: fastfetch-solaris-amd64 name: fastfetch-solaris-amd64
path: ./fastfetch-*.* path: ./fastfetch-*.*
+3 -3
View File
@@ -106,7 +106,7 @@ jobs:
- if: github.event_name == 'push' && github.repository == 'fastfetch-cli/fastfetch' - if: github.event_name == 'push' && github.repository == 'fastfetch-cli/fastfetch'
id: upload-unsigned-artifact id: upload-unsigned-artifact
name: upload artifacts for signing name: upload artifacts for signing
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with: with:
name: fastfetch-windows-${{ inputs.arch }} name: fastfetch-windows-${{ inputs.arch }}
path: | path: |
@@ -134,14 +134,14 @@ jobs:
run: 7z a -t7z -mx9 -bd -y fastfetch-windows-${{ inputs.arch }}.7z LICENSE *.dll fastfetch.exe flashfetch.exe presets run: 7z a -t7z -mx9 -bd -y fastfetch-windows-${{ inputs.arch }}.7z LICENSE *.dll fastfetch.exe flashfetch.exe presets
- name: upload true artifacts - name: upload true artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with: with:
name: fastfetch-windows-${{ inputs.arch }} name: fastfetch-windows-${{ inputs.arch }}
path: ./fastfetch-windows-${{ inputs.arch }}.* path: ./fastfetch-windows-${{ inputs.arch }}.*
overwrite: true overwrite: true
- name: upload benchmark data - name: upload benchmark data
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with: with:
name: benchmark-windows-${{ inputs.arch }} name: benchmark-windows-${{ inputs.arch }}
path: benchmark.json path: benchmark.json
-1
View File
@@ -2,7 +2,6 @@
Bugfixes: Bugfixes:
* Improved uptime detection on SunOS via kstat. (#2674, Uptime, SunOS) * Improved uptime detection on SunOS via kstat. (#2674, Uptime, SunOS)
* Fixed substring formatting returning the remaining string when a negative end index is before the start of the string. (General)
# 2.70.0 # 2.70.0
+1 -1
View File
@@ -552,7 +552,7 @@ static bool parseFormatString(FFstrbuf* buffer, const FFstrbuf* formatstr, uint3
if (end < 0) { if (end < 0) {
end = (int32_t) tempString.length + end; end = (int32_t) tempString.length + end;
} }
if (end >= 0 && (uint32_t) end > tempString.length) { if ((uint32_t) end > tempString.length) {
end = (int32_t) tempString.length; end = (int32_t) tempString.length;
} }
if (end > start) { if (end > start) {
+21 -36
View File
@@ -149,32 +149,6 @@ void restoreTerm(void) {
tcsetattr(ftty, TCSAFLUSH, &oldTerm); tcsetattr(ftty, TCSAFLUSH, &oldTerm);
} }
static const char* waitForTerminalResponse(void) {
#ifndef __APPLE__
const int pollResult = poll(&(struct pollfd) { .fd = ftty, .events = POLLIN }, 1, FF_IO_TERM_RESP_WAIT_MS);
if (pollResult <= 0) {
FF_DEBUG("poll(/dev/tty) returned %d after %d ms: %s",
pollResult, FF_IO_TERM_RESP_WAIT_MS, pollResult == 0 ? "timed out" : strerror(errno));
return "poll(/dev/tty) timeout or failed";
}
#else
{
// On macOS, poll(/dev/tty) always returns immediately
// See also https://nathancraddock.com/blog/macos-dev-tty-polling/
fd_set rd;
FD_ZERO(&rd);
FD_SET(ftty, &rd);
const int selectResult = select(ftty + 1, &rd, nullptr, nullptr, &(struct timeval) { .tv_sec = FF_IO_TERM_RESP_WAIT_MS / 1000, .tv_usec = (FF_IO_TERM_RESP_WAIT_MS % 1000) * 1000 });
if (selectResult <= 0) {
FF_DEBUG("select(/dev/tty) returned %d after %d ms: %s",
selectResult, FF_IO_TERM_RESP_WAIT_MS, selectResult == 0 ? "timed out" : strerror(errno));
return "select(/dev/tty) timeout or failed";
}
}
#endif
return nullptr;
}
const char* ffGetTerminalResponse(const char* request, int nParams, const char* format, ...) { const char* ffGetTerminalResponse(const char* request, int nParams, const char* format, ...) {
if (ftty < 0) { if (ftty < 0) {
ftty = open("/dev/tty", O_RDWR | O_NOCTTY | O_CLOEXEC); ftty = open("/dev/tty", O_RDWR | O_NOCTTY | O_CLOEXEC);
@@ -200,10 +174,28 @@ const char* ffGetTerminalResponse(const char* request, int nParams, const char*
ffWriteFDData(ftty, strlen(request), request); ffWriteFDData(ftty, strlen(request), request);
// Give the terminal some time to respond // Give the terminal some time to respond
const char* error = waitForTerminalResponse(); #ifndef __APPLE__
if (error) { const int pollResult = poll(&(struct pollfd) { .fd = ftty, .events = POLLIN }, 1, FF_IO_TERM_RESP_WAIT_MS);
return error; if (pollResult <= 0) {
FF_DEBUG("poll(/dev/tty) returned %d after %d ms: %s",
pollResult, FF_IO_TERM_RESP_WAIT_MS, pollResult == 0 ? "timed out" : strerror(errno));
return "poll(/dev/tty) timeout or failed";
} }
#else
{
// On macOS, poll(/dev/tty) always returns immediately
// See also https://nathancraddock.com/blog/macos-dev-tty-polling/
fd_set rd;
FD_ZERO(&rd);
FD_SET(ftty, &rd);
const int selectResult = select(ftty + 1, &rd, nullptr, nullptr, &(struct timeval) { .tv_sec = FF_IO_TERM_RESP_WAIT_MS / 1000, .tv_usec = (FF_IO_TERM_RESP_WAIT_MS % 1000) * 1000 });
if (selectResult <= 0) {
FF_DEBUG("select(/dev/tty) returned %d after %d ms: %s",
selectResult, FF_IO_TERM_RESP_WAIT_MS, selectResult == 0 ? "timed out" : strerror(errno));
return "select(/dev/tty) timeout or failed";
}
}
#endif
char buffer[1024]; char buffer[1024];
size_t bytesRead = 0; size_t bytesRead = 0;
@@ -212,13 +204,6 @@ const char* ffGetTerminalResponse(const char* request, int nParams, const char*
va_start(args, format); va_start(args, format);
while (true) { while (true) {
// The response may arrive in several chunks; a terminal that sends an incomplete
// response would otherwise block `read` forever
if (bytesRead > 0 && (error = waitForTerminalResponse())) {
va_end(args);
return error;
}
ssize_t nRead = read(ftty, buffer + bytesRead, sizeof(buffer) - bytesRead - 1); ssize_t nRead = read(ftty, buffer + bytesRead, sizeof(buffer) - bytesRead - 1);
if (nRead <= 0) { if (nRead <= 0) {
+23 -43
View File
@@ -414,35 +414,6 @@ void ffListFilesRecursively(const char* path, bool pretty) {
listFilesRecursively(folder.length, &folder, 0, nullptr, pretty); listFilesRecursively(folder.length, &folder, 0, nullptr, pretty);
} }
static const char* waitForTerminalResponse(HANDLE hInput) {
while (true) {
NTSTATUS status = NtWaitForSingleObject(hInput, FALSE, &(LARGE_INTEGER) { .QuadPart = (int64_t) FF_IO_TERM_RESP_WAIT_MS * -10000 });
if (status != STATUS_WAIT_0) {
FF_DEBUG("NtWaitForSingleObject() failed or timeout: %s", ffDebugNtStatus(status));
return "NtWaitForSingleObject() failed or timeout";
}
// Ignore all unexpected input events
INPUT_RECORD record;
DWORD len = 0;
if (!PeekConsoleInputW(hInput, &record, 1, &len)) {
return nullptr;
}
// Key-up events carry no input for `ReadFile`; leaving one in the buffer would make the
// wait return while the next `ReadFile` still blocks
if (
record.EventType == KEY_EVENT &&
record.Event.KeyEvent.bKeyDown &&
record.Event.KeyEvent.uChar.UnicodeChar != L'\r' &&
record.Event.KeyEvent.uChar.UnicodeChar != L'\n') {
return nullptr;
}
ReadConsoleInputW(hInput, &record, 1, &len);
}
}
const char* ffGetTerminalResponse(const char* request, int nParams, const char* format, ...) { const char* ffGetTerminalResponse(const char* request, int nParams, const char* format, ...) {
HANDLE hInput = GetStdHandle(STD_INPUT_HANDLE); HANDLE hInput = GetStdHandle(STD_INPUT_HANDLE);
FF_AUTO_CLOSE_FD HANDLE hConin = INVALID_HANDLE_VALUE; FF_AUTO_CLOSE_FD HANDLE hConin = INVALID_HANDLE_VALUE;
@@ -469,10 +440,29 @@ const char* ffGetTerminalResponse(const char* request, int nParams, const char*
WriteFile(hOutput, request, (DWORD) strlen(request), &bytes, nullptr); WriteFile(hOutput, request, (DWORD) strlen(request), &bytes, nullptr);
} }
const char* error = waitForTerminalResponse(hInput); while (true) {
if (error) { NTSTATUS status = NtWaitForSingleObject(hInput, FALSE, &(LARGE_INTEGER) { .QuadPart = (int64_t) FF_IO_TERM_RESP_WAIT_MS * -10000 });
SetConsoleMode(hInput, inputMode); if (status != STATUS_WAIT_0) {
return error; FF_DEBUG("NtWaitForSingleObject() failed or timeout: %s", ffDebugNtStatus(status));
SetConsoleMode(hInput, inputMode);
return "NtWaitForSingleObject() failed or timeout";
}
// Ignore all unexpected input events
INPUT_RECORD record;
DWORD len = 0;
if (!PeekConsoleInputW(hInput, &record, 1, &len)) {
break;
}
if (
record.EventType == KEY_EVENT &&
record.Event.KeyEvent.uChar.UnicodeChar != L'\r' &&
record.Event.KeyEvent.uChar.UnicodeChar != L'\n') {
break;
} else {
ReadConsoleInputW(hInput, &record, 1, &len);
}
} }
va_list args; va_list args;
@@ -482,16 +472,6 @@ const char* ffGetTerminalResponse(const char* request, int nParams, const char*
uint32_t bytesRead = 0; uint32_t bytesRead = 0;
while (true) { while (true) {
// The response may arrive in several chunks; a terminal that sends an incomplete
// response would otherwise block `ReadFile` forever
if (bytesRead > 0 && (error = waitForTerminalResponse(hInput))) {
va_end(args);
if (hasInputMode) {
SetConsoleMode(hInput, inputMode);
}
return error;
}
DWORD bytes = 0; DWORD bytes = 0;
BOOL readOk = ReadFile(hInput, buffer + bytesRead, (DWORD) (sizeof(buffer) - 1 - bytesRead), &bytes, nullptr); BOOL readOk = ReadFile(hInput, buffer + bytesRead, (DWORD) (sizeof(buffer) - 1 - bytesRead), &bytes, nullptr);
if (!readOk || bytes == 0) { if (!readOk || bytes == 0) {
+4 -4
View File
@@ -52,15 +52,15 @@ const char* ffDetectWifi(FFlist* result) {
if (inf.ssid) { // https://developer.apple.com/forums/thread/732431 if (inf.ssid) { // https://developer.apple.com/forums/thread/732431
ffStrbufAppendS(&item->conn.ssid, inf.ssid.UTF8String); ffStrbufAppendS(&item->conn.ssid, inf.ssid.UTF8String);
} else if (networkProfile.ssid) { // Dead in macOS 27.2 } else if (networkProfile.ssid) {
ffStrbufSetStatic(&item->conn.ssid, networkProfile.ssid.UTF8String); ffStrbufSetStatic(&item->conn.ssid, inf.configuration.networkProfiles.firstObject.ssid.UTF8String);
} else { } else {
ffStrbufSetStatic(&item->conn.ssid, "<redacted>"); ffStrbufSetStatic(&item->conn.ssid, "<redacted>"); // https://developer.apple.com/forums/thread/732431
} }
if (inf.bssid) { if (inf.bssid) {
ffStrbufAppendS(&item->conn.bssid, inf.bssid.UTF8String); ffStrbufAppendS(&item->conn.bssid, inf.bssid.UTF8String);
} else if (networkProfile.bssidList) { // Dead in macOS 27.2 } else if (networkProfile.bssidList) {
ffStrbufSetStatic(&item->conn.bssid, [networkProfile.bssidList.firstObject[@"BSSID"] UTF8String]); ffStrbufSetStatic(&item->conn.bssid, [networkProfile.bssidList.firstObject[@"BSSID"] UTF8String]);
} else { } else {
ffStrbufSetStatic(&item->conn.bssid, "<redacted>"); ffStrbufSetStatic(&item->conn.bssid, "<redacted>");
-1
View File
@@ -96,7 +96,6 @@ int main(void) {
VERIFY("output({1~10,10})", "12345 67890", "output()"); VERIFY("output({1~10,10})", "12345 67890", "output()");
VERIFY("output({1~10,5})", "12345 67890", "output()"); VERIFY("output({1~10,5})", "12345 67890", "output()");
VERIFY("output({1~3,-3})", "12345 67890", "output(45 67)"); VERIFY("output({1~3,-3})", "12345 67890", "output(45 67)");
VERIFY("output({1~0,-12})", "12345 67890", "output()");
VERIFY("output({1~-5,-3})", "12345 67890", "output(67)"); VERIFY("output({1~-5,-3})", "12345 67890", "output(67)");
VERIFY("output({1~-0,10})", "12345 67890", "output(12345 6789)"); VERIFY("output({1~-0,10})", "12345 67890", "output(12345 6789)");
VERIFY("output({1~-3,-5})", "12345 67890", "output()"); VERIFY("output({1~-3,-5})", "12345 67890", "output()");