Skip to content

Commit 8082243

Browse files
committed
Minor update.
1 parent 14efde5 commit 8082243

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

hpcopr/general_funcs.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2679,6 +2679,18 @@ int base64encode(char* plain_string, char* export_path){
26792679
return 0;
26802680
}
26812681

2682+
/*
2683+
* This function resets Windows display to make sure the print is good.
2684+
* For *nix, do nothing
2685+
*/
2686+
int reset_windows_cmd_display(void){
2687+
#ifdef _WIN32
2688+
return system("Color");
2689+
#else
2690+
return 0;
2691+
#endif
2692+
}
2693+
26822694
/*int main(){
26832695
base64decode("KihlbmNvZGVkX3N0cmluZytqKzIpPWVuY29kZV9jaGFyc1soKHBsYWluX3N0cmluZ1tpKjMrMV0mMHgwRik8PDIpfChwbGFpbl9zdHJpbmdbaSozKzJdPj42KV07TK==","");
26842696
base64encode("*(encoded_string+j+2)=encode_chars[((plain_string[i*3+1]&0x0F)<<2)|(plain_string[i*3+2]>>6)];L","");

hpcopr/general_funcs.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,6 @@ unsigned char get_base64_index(char base64_char);
9797
int base64decode(char* encoded_string, char* export_path);
9898
int base64encode(char* plain_string, char* export_path);
9999

100+
int reset_windows_cmd_display(void);
101+
100102
#endif

hpcopr/general_print_info.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ void print_header(void){
3737
struct tm* time_p=NULL;
3838
time(&current_time_long);
3939
time_p=localtime(&current_time_long);
40+
reset_windows_cmd_display();
4041
printf(GENERAL_BOLD "//\\\\\\ HPC +-> Welcome to HPC-NOW Cluster Operator! Version: %s\n",CORE_VERSION_CODE);
4142
printf(GENERAL_BOLD "\\\\/// NOW +-> %d-%d-%d %d:%d:%d\n",time_p->tm_year+1900,time_p->tm_mon+1,time_p->tm_mday,time_p->tm_hour,time_p->tm_min,time_p->tm_sec);
4243
printf(GENERAL_BOLD "Copyright (c) 2024 Shanghai HPC-NOW Technologies Co., Ltd LICENSE: MIT" RESET_DISPLAY "\n\n");

installer/installer.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ int check_internet_installer(void){
4747
}
4848

4949
void print_header_installer(void){
50+
reset_windows_cmd_display();
5051
printf(GENERAL_BOLD "| Welcome to the HPC-NOW Service Installer! Version: %s\n",INSTALLER_VERSION_CODE);
5152
printf(GENERAL_BOLD "| Copyright (c) 2023 Shanghai HPC-NOW Technologies Co., Ltd LICENSE: MIT\n\n");
5253
printf(GENERAL_BOLD "| This is free software; see the source for copying conditions. There is NO\n");

0 commit comments

Comments
 (0)