Windows: fix bug that line buffering doesn't work properly

This commit is contained in:
李通洲
2023-01-12 00:11:25 +08:00
parent c4aa55d522
commit 387b8298bd
3 changed files with 10 additions and 1 deletions
+1
View File
@@ -25,6 +25,7 @@ Logos:
Bugfixes:
* `--logo-type` now does accept `iterm` too (@CarterLi, #374)
* Fix mintty terminal font detection
* Fix bug that line buffering doesn't work properly (Windows)
Other:
* Fixed a Typo in iterm error message (@jessebot, #376)
+5 -1
View File
@@ -645,7 +645,6 @@ if(ENABLE_THREADS)
endif()
endif()
if(ENABLE_BUFFER)
target_compile_definitions(libfastfetch PRIVATE FF_ENABLE_BUFFER)
endif()
@@ -720,6 +719,11 @@ target_link_libraries(flashfetch
PRIVATE libfastfetch
)
if(ENABLE_BUFFER) # FF_ENABLE_BUFFER is used in fastfetch.c
target_compile_definitions(fastfetch PRIVATE FF_ENABLE_BUFFER)
target_compile_definitions(flashfetch PRIVATE FF_ENABLE_BUFFER)
endif()
if(WIN32)
set(TARGET_NAME fastfetch)
target_sources(fastfetch
+4
View File
@@ -1482,6 +1482,10 @@ int main(int argc, const char** argv)
ffStart(&instance);
#if defined(_WIN32) && defined(FF_ENABLE_BUFFER)
fflush(stdout);
#endif
//Parse the structure and call the modules
uint32_t startIndex = 0;
while (startIndex < data.structure.length)