diff --git a/uwufetch.c b/uwufetch.c index 9490a23..6432a24 100644 --- a/uwufetch.c +++ b/uwufetch.c @@ -145,7 +145,11 @@ struct info { #endif // _WIN32 }; -char* MOVE_CURSOR = "\033[18C"; // moves the cursor after printing the image or the ascii logo +#ifdef _WIN32 +char* MOVE_CURSOR = "\033[21C"; // moves the cursor after printing the image or the ascii logo +#else +char* MOVE_CURSOR = "\033[18C"; +#endif // reads the config file struct configuration parse_config(struct info* user_info) { @@ -510,7 +514,7 @@ void write_cache(struct info* user_info) { fprintf(stderr, "Failed to write to %s!", cache_file); return; } - // writing all info to the cache file +// writing all info to the cache file #ifdef __APPLE__ user_info->uptime = uptime_apple(); #else @@ -739,6 +743,23 @@ void remove_brackets(char* str) { i++; } +#ifdef _WIN32 +// windows sucks and hasn't a strstep, so I copied one from +// https://stackoverflow.com/questions/8512958/is-there-a-windows-variant-of-strsep-function +char* strsep(char** stringp, const char* delim) { + char* start = *stringp; + char* p; + p = (start != NULL) ? strpbrk(start, delim) : NULL; + if (p == NULL) + *stringp = NULL; + else { + *p = '\0'; + *stringp = p + 1; + } + return start; +} +#endif + // uwufies kernel name void uwu_kernel(char* kernel) { #define KERNEL_TO_UWU(str, original, uwufied) \ @@ -1229,23 +1250,6 @@ void usage(char* arg) { NORMAL); } -#ifdef _WIN32 -// windows sucks and hasn't a strstep, so I copied one from -// https://stackoverflow.com/questions/8512958/is-there-a-windows-variant-of-strsep-function -char* strsep(char** stringp, const char* delim) { - char* start = *stringp; - char* p; - p = (start != NULL) ? strpbrk(start, delim) : NULL; - if (p == NULL) - *stringp = NULL; - else { - *p = '\0'; - *stringp = p + 1; - } - return start; -} -#endif - // the main function is on the bottom of the file to avoid double function declarations int main(int argc, char* argv[]) { char* cache_env = getenv("UWUFETCH_CACHE_ENABLED"); // getting cache env variable