From ee18bc69e033690da38be350b08bddf57387bc94 Mon Sep 17 00:00:00 2001 From: cyd01 Date: Mon, 1 Mar 2021 09:58:45 +0100 Subject: [PATCH] Tagging the 0.74.4.7 release of the KiTTY project. --- 0.74_My_PuTTY/config.c | 13 +++-- 0.74_My_PuTTY/version.h | 2 +- 0.74_My_PuTTY/windows/MAKEFILE.MINGW | 2 +- 0.74_My_PuTTY/windows/version_minor.txt | 2 +- 0.74_My_PuTTY/windows/win_res.rc2 | 2 +- 0.74_My_PuTTY/windows/windlg.c | 9 ++- 0.74_My_PuTTY/windows/winpgnt.c | 9 ++- docs/version.txt | 2 +- kitty.c | 5 ++ kitty_commun.c | 10 +++- kitty_tools.c | 76 +++++++++++++------------ 11 files changed, 78 insertions(+), 54 deletions(-) diff --git a/0.74_My_PuTTY/config.c b/0.74_My_PuTTY/config.c index 53e108b..f043a71 100644 --- a/0.74_My_PuTTY/config.c +++ b/0.74_My_PuTTY/config.c @@ -825,14 +825,13 @@ void proxy_selection_handler(union control *ctrl, dlgparam *dlg, void *data, int * remember what the right value is supposed to be when * operations below cause reentrant calls to this function. */ char * oldproxy = conf_get_str(conf, CONF_proxyselection); - dlg_update_start(ctrl, dlg); dlg_listbox_clear(ctrl, dlg); for (i = 0; i < lenof(proxies); i++) { if( proxies[i].name==NULL ) break ; dlg_listbox_addwithid(ctrl, dlg, proxies[i].name, proxies[i].val); } - for (i = j = 0; i < lenof(proxies); i++) { + for (i =0, j = 0 ; i < lenof(proxies); i++) { if( proxies[i].name==NULL ) break ; if ( !strcmp(oldproxy,proxies[i].name) ) { dlg_listbox_select(ctrl, dlg, i); @@ -1410,16 +1409,18 @@ static void sessionsaver_handler(union control *ctrl, dlgparam *dlg, selectedsession = (char*)malloc(strlen(sessionname)+1) ; strcpy(selectedsession,sessionname); do_defaults(sessionname, conf) ; - conf_set_str(conf,CONF_proxyselection,"- Session defined proxy -"); - proxy_selection_handler(ctrlProxyList, dlg, data, EVENT_REFRESH ) ; + if( !GetPuttyFlag() && GetProxySelectionFlag() ) { + conf_set_str(conf,CONF_proxyselection,"- Session defined proxy -"); + proxy_selection_handler(ctrlProxyList, dlg, data, EVENT_REFRESH ) ; + } conf_set_str(conf,CONF_host,""); dlg_editbox_set(ctrlHostnameEdit, dlg,""); if( strlen(ssd->savedsession) > 0 ) { ssd->savedsession[0]='\0' ; dlg_refresh(ssd->editbox, dlg) ; - } - sessionsaver_handler( ctrlSessionList, dlg, data, EVENT_REFRESH ) ; } + sessionsaver_handler( ctrlSessionList, dlg, data, EVENT_REFRESH ) ; + } else if (!ssd->midsession && // creer un nouveau folder ssd->createbutton && ctrl == ssd->createbutton) { if( strlen(ssd->savedsession) > 0 ) { diff --git a/0.74_My_PuTTY/version.h b/0.74_My_PuTTY/version.h index 536a9e1..36599ee 100644 --- a/0.74_My_PuTTY/version.h +++ b/0.74_My_PuTTY/version.h @@ -1,5 +1,5 @@ #define RELEASE 0.74 #define TEXTVER "Release 0.74" #define SSHVER "-Release-0.74" -#define BINARY_VERSION 0,74,4,6 +#define BINARY_VERSION 0,74,4,7 #define SOURCE_COMMIT "unavailable" diff --git a/0.74_My_PuTTY/windows/MAKEFILE.MINGW b/0.74_My_PuTTY/windows/MAKEFILE.MINGW index 703cf81..6f2d992 100644 --- a/0.74_My_PuTTY/windows/MAKEFILE.MINGW +++ b/0.74_My_PuTTY/windows/MAKEFILE.MINGW @@ -1984,7 +1984,7 @@ kitty.dll: ../../kitty_dll.c kitty_dll.res.o upx --best --compress-icons=2 kitty.dll ../../kitty_ini.h: ../../kitty_ini.txt - ( printf 'static char *default_init_file_content = "' ; sed 's/\\/\\\\/g' ../../kitty_ini.txt | sed 's/$$/\\n\\/' ; printf '" ;\n' ) > ../../kitty_ini.h + ( printf 'char default_init_file_content[] = "' ; sed 's/\\/\\\\/g' ../../kitty_ini.txt | sed 's/$$/\\n\\/' ; printf '" ;\n' ) > ../../kitty_ini.h ../../kitty_help.h: ../../docs/pages/CommandLine.md ( printf 'static char *default_help_file_content = "' ; sed -n '/CmdLineOptions_begin/,/CmdLineOptions_end/p' ../../docs/pages/CommandLine.md|sed 's///'|sed 's/\*\*//g'|sed 's/$$/\\r\\n\\/' ; printf '" ;\n' ) > ../../kitty_help.h diff --git a/0.74_My_PuTTY/windows/version_minor.txt b/0.74_My_PuTTY/windows/version_minor.txt index 1e8b314..7f8f011 100644 --- a/0.74_My_PuTTY/windows/version_minor.txt +++ b/0.74_My_PuTTY/windows/version_minor.txt @@ -1 +1 @@ -6 +7 diff --git a/0.74_My_PuTTY/windows/win_res.rc2 b/0.74_My_PuTTY/windows/win_res.rc2 index e427397..f5bdeb4 100644 --- a/0.74_My_PuTTY/windows/win_res.rc2 +++ b/0.74_My_PuTTY/windows/win_res.rc2 @@ -211,7 +211,7 @@ END //IDD_KITTYABOUT DIALOGEX 0, 0, 240, 70 IDD_KITTYABOUT DIALOGEX 0, 0, 245, 90 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU | DS_SETFONT CAPTION "About KiTTY" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN diff --git a/0.74_My_PuTTY/windows/windlg.c b/0.74_My_PuTTY/windows/windlg.c index 08f48c0..6e2c1c1 100644 --- a/0.74_My_PuTTY/windows/windlg.c +++ b/0.74_My_PuTTY/windows/windlg.c @@ -283,7 +283,7 @@ static INT_PTR CALLBACK AboutProc(HWND hwnd, UINT msg, GetObject(hFontTitle,sizeof(LOGFONT),&lf); lf.lfWeight = FW_BOLD; hFontTitle = CreateFontIndirect(&lf); - } + } // Font setup if (NULL == (hFontHover = (HFONT)SendDlgItemMessage(hwnd,IDC_EMAIL,WM_GETFONT,0,0))) hFontHover = GetStockObject(DEFAULT_GUI_FONT); @@ -977,8 +977,11 @@ void modal_about_box(HWND hwnd) { EnableWindow(hwnd, 0); #if (defined MOD_PERSO) && (!defined FLJ) - if( get_param("PUTTY") ) DialogBox(hinst, MAKEINTRESOURCE(IDD_ABOUTBOX), hwnd, AboutProcOrig); - else DialogBox(hinst, MAKEINTRESOURCE(IDD_KITTYABOUT), hwnd, AboutProc); + if( GetPuttyFlag() ) { + DialogBox(hinst, MAKEINTRESOURCE(IDD_ABOUTBOX), hwnd, AboutProcOrig) ; + } else { + DialogBox(hinst, MAKEINTRESOURCE(IDD_KITTYABOUT), hwnd, AboutProc) ; + } #else DialogBox(hinst, MAKEINTRESOURCE(IDD_ABOUTBOX), hwnd, AboutProc); #endif diff --git a/0.74_My_PuTTY/windows/winpgnt.c b/0.74_My_PuTTY/windows/winpgnt.c index 565fa18..8a05033 100644 --- a/0.74_My_PuTTY/windows/winpgnt.c +++ b/0.74_My_PuTTY/windows/winpgnt.c @@ -1266,8 +1266,13 @@ int WINAPI Agent_WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show if ( (fp = fopen(b, "r")) != NULL) { putty_path = dupstr(b); fclose(fp); - } else - putty_path = NULL; + } else { + strcpy(r, "kitty_portable.exe"); + if ( (fp = fopen(b, "r")) != NULL) { + putty_path = dupstr(b); + fclose(fp); + } else putty_path = NULL; + } } #else } else diff --git a/docs/version.txt b/docs/version.txt index 1f6cf46..cd55636 100644 --- a/docs/version.txt +++ b/docs/version.txt @@ -1 +1 @@ -0.74.4.6 \ No newline at end of file +0.74.4.7 \ No newline at end of file diff --git a/kitty.c b/kitty.c index 3eb74d8..0d09870 100644 --- a/kitty.c +++ b/kitty.c @@ -1260,6 +1260,11 @@ char * GetHelpMessage(void) { void CreateIniFile( const char * filename ) { FILE *fp; if( (fp=fopen(filename,"w")) != NULL ) { + if( IniFileFlag == SAVEMODE_DIR ) { + int p = poss( ";savemode=registry", default_init_file_content ); + del( default_init_file_content, p, 18 ); + insert( default_init_file_content, "savemode=dir", p ); + } fputs(default_init_file_content,fp); fclose(fp); } diff --git a/kitty_commun.c b/kitty_commun.c index 35c29e8..4e2bb38 100644 --- a/kitty_commun.c +++ b/kitty_commun.c @@ -272,7 +272,13 @@ int LoadParametersLight( void ) { } #endif } - + if( ReadParameterLight( INIT_SECTION, "fileextension", buffer ) ) { + if( strlen(buffer) > 0 ) { + if( buffer[0] != '.' ) { strcpy( FileExtension, "." ) ; } else { strcpy( FileExtension, "" ) ; } + strcat( FileExtension, buffer ) ; + while( FileExtension[strlen(FileExtension)-1]==' ' ) { FileExtension[strlen(FileExtension)-1] = '\0' ; } + } + } if( ReadParameterLight( INIT_SECTION, "autostoresshkey", buffer ) ) { if( !stricmp( buffer, "YES" ) ) SetAutoStoreSSHKeyFlag( 1 ) ; } if( ReadParameterLight( "Agent", "messageonkeyusage", buffer ) ) { if( !stricmp( buffer, "YES" ) ) SetShowBalloonOnKeyUsage() ; } if( ReadParameterLight( "Agent", "askconfirmation", buffer ) ) { @@ -283,7 +289,7 @@ int LoadParametersLight( void ) { if( ReadParameterLight( "Agent", "scrumble", buffer ) ) { if( !stricmp( buffer, "YES" ) ) SetScrumbleKeyFlag(1) ; } return ret ; - } +} // Positionne un flag permettant de determiner si on est connecte int is_backend_connected = 0 ; diff --git a/kitty_tools.c b/kitty_tools.c index 6949ffb..1c4235e 100644 --- a/kitty_tools.c +++ b/kitty_tools.c @@ -11,7 +11,7 @@ char *stristr (const char *meule_de_foin, const char *aiguille) { free( c2 ) ; free( c1 ) ; return res ; - } +} /* Fonction permettant d'inserer une chaine dans une autre */ int insert( char * ch, const char * c, const int ipos ) { @@ -21,9 +21,9 @@ int insert( char * ch, const char * c, const int ipos ) { if( (size_t) i > ( strlen( ch ) + 1 ) ) i = strlen( ch ) + 1 ; for( k = strlen( ch ) ; k >= ( i - 1 ) ; k-- ) ch[k + len] = ch[k] ; for( k = 0 ; k < len ; k++ ) ch[k + i - 1] = c[k] ; - } - return strlen( ch ) ; } + return strlen( ch ) ; +} /* Fonction permettant de supprimer une partie d'une chaine de caracteres */ int del( char * ch, const int start, const int length ) { @@ -32,15 +32,18 @@ int del( char * ch, const int start, const int length ) { if( ( start == 1 ) && ( length >= len ) ) { ch[0] = '\0' ; len = 0 ; } if( ( start > 0 ) && ( start <= len ) && ( length > 0 ) ) { for( k = start - 1 ; k < ( len - length ) ; k++ ) { - if( k < ( len - length ) ) ch[k] = ch[ k + length ] ; - else ch = '\0' ; + if( k < ( len - length ) ) { + ch[k] = ch[ k + length ] ; + } else { + ch[k] = '\0' ; } + } k = len - length ; if( ( start + length ) > len ) k = start - 1 ; ch[k] = '\0' ; - } - return strlen( ch ) ; } + return strlen( ch ) ; +} /* Fonction permettant de retrouver la position d'une chaine dans une autre chaine */ int poss( const char * c, const char * ch ) { @@ -57,7 +60,7 @@ int poss( const char * c, const char * ch ) { free( ch1 ) ; free( c1 ) ; return res ; - } +} /* Fonction permettant de retrouver la position d'une chaîne de caracteres dans une chaine a partir d'une position donnee */ int posi( const char * c, const char * ch, const int ipos ) { @@ -67,7 +70,7 @@ int posi( const char * c, const char * ch, const int ipos ) { res = poss( c, ch + ( ipos - 1 ) ) ; if( res > 0 ) return res + ( ipos -1 ) ; else return 0 ; - } +} // Teste l'existance d'un fichier int existfile( const char * filename ) { @@ -79,7 +82,7 @@ int existfile( const char * filename ) { if( ( statBuf.st_mode & _S_IFMT ) == _S_IFREG ) { return 1 ; } else { return 0 ; } - } +} // Teste l'existance d'un repertoire int existdirectory( const char * filename ) { @@ -91,7 +94,7 @@ int existdirectory( const char * filename ) { if( ( statBuf.st_mode & _S_IFMT ) == _S_IFDIR ) { return 1 ; } else { return 0 ; } - } +} /* Donne la taille d'un fichier */ long filesize( const char * filename ) { @@ -108,7 +111,7 @@ long filesize( const char * filename ) { fclose( fp ) ; return length ; - } +} // Supprime les double anti-slash void DelDoubleBackSlash( char * st ) { @@ -116,10 +119,10 @@ void DelDoubleBackSlash( char * st ) { while( st[i] != '\0' ) { if( (st[i] == '\\' )&&(st[i+1]=='\\' ) ) { for( j=i+1 ; j 0 ) if( !strcmp( list[i], name ) ) return 1 ; i++ ; - } - return 0 ; } + return 0 ; +} // Supprime une chaine d'une liste de chaines void StringList_Del( char **list, const char * name ) { @@ -153,10 +156,10 @@ void StringList_Del( char **list, const char * name ) { if( strlen( list[i] ) > 0 ) if( !strcmp( list[i], name ) ) { strcpy( list[i], "" ) ; - } + } i++; - } } +} // Reorganise l'ordre d'une liste de chaines en montant la chaine selectionnee d'un cran void StringList_Up( char **list, const char * name ) { @@ -174,12 +177,12 @@ void StringList_Up( char **list, const char * name ) { list[i] = (char*) malloc( strlen( buffer ) +1 ) ; strcpy( list[i], buffer ); free( buffer ); - } - return ; } - i++ ; + return ; } + i++ ; } +} // Positionne l'environnement int putenv (const char *string) ; @@ -191,19 +194,21 @@ int set_env( char * name, char * value ) { res = putenv( (const char *) buffer ) ; free( buffer ) ; return res ; - } +} + int add_env( char * name, char * value ) { int res = 0 ; char * npst = getenv( name ), * vpst = NULL ; - if( npst==NULL ) { res = set_env( name, value ) ; } - else { + if( npst==NULL ) { + res = set_env( name, value ) ; + } else { vpst = (char*) malloc( strlen(npst)+strlen(value)+20 ) ; sprintf( vpst, "%s=%s;%s", name, npst, value ) ; res = set_env( name, vpst ) ; free( vpst ) ; - } - return res ; } + return res ; +} // Creer un repertoire recurssif (rep1 / rep2 / ...) int _mkdir (const char*); @@ -218,9 +223,9 @@ int MakeDir( const char * directory ) { if( (directory[i]=='\\')||(directory[i]=='/') ) { fullpath[j]='\\' ; while( (directory[i+1]==' ')||(directory[i+1]==' ') ) i++ ; - } - else fullpath[j]=directory[i] ; - } + } else + fullpath[j]=directory[i] ; + } fullpath[j+1]='\0' ; // On supprime les espaces, les / et les \\ à la fin @@ -230,9 +235,9 @@ int MakeDir( const char * directory ) { if( fullpath[i] == '\\' ) { buffer[j]='\\' ; while( (i>0)&&((fullpath[i-1]==' ')||(fullpath[i-1]==' ')) ) i-- ; - } - else buffer[j]=fullpath[i] ; - } + } else + buffer[j]=fullpath[i] ; + } j++; // On supprime les espace au début @@ -247,10 +252,9 @@ int MakeDir( const char * directory ) { _mkdir( fullpath ) ; p[0]='\\' ; pst=p+1; - } + } _mkdir( fullpath ) ; } return existdirectory(fullpath) ; } -