From aff46c126305a8b57910a60e4fe83208e11d4cb4 Mon Sep 17 00:00:00 2001 From: zmatsuo <6488847+zmatsuo@users.noreply.github.com> Date: Sun, 17 Mar 2024 22:46:43 +0900 Subject: [PATCH 1/2] =?UTF-8?q?TTSSH=E3=81=AE=E3=82=AA=E3=83=97=E3=82=B7?= =?UTF-8?q?=E3=83=A7=E3=83=B3=E3=81=AE=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB?= =?UTF-8?q?=E5=90=8D=E3=81=8C=E7=B5=B6=E5=AF=BE=E3=83=91=E3=82=B9=E3=81=A7?= =?UTF-8?q?=E3=81=AA=E3=81=84=E3=81=A8=E3=81=8D=E3=81=AE=E5=9F=BA=E6=BA=96?= =?UTF-8?q?=E3=81=A8=E3=81=AA=E3=82=8B=E3=83=91=E3=82=B9=E3=82=92=E5=A4=89?= =?UTF-8?q?=E6=9B=B4=20#159?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 次のオプション時 - /f= - /ssh-f= - /ssh-consume= - /keyfile= - %APPDATA%\teraterm5\ からの相対パスとした - 修正前は ttxssh.dll(ttermpro.exe) からの相対パスだった - ドキュメント修正 --- doc/en/html/commandline/ttssh.html | 8 +++---- doc/ja/html/commandline/ttssh.html | 8 +++---- ttssh2/ttxssh/ttxssh.c | 34 ++++++++++++------------------ ttssh2/ttxssh/ttxssh.h | 4 ++-- 4 files changed, 24 insertions(+), 30 deletions(-) diff --git a/doc/en/html/commandline/ttssh.html b/doc/en/html/commandline/ttssh.html index ffb897866..0899fe737 100644 --- a/doc/en/html/commandline/ttssh.html +++ b/doc/en/html/commandline/ttssh.html @@ -31,19 +31,19 @@

Options

/f=<file>
read teraterm.ini(file)
- If this value is not a full path, it is understood as a relative path from ttxssh.dll. + If this value is not a full path, it is understood as a relative path from configuration file folder.
/ssh-f=<file>
read teraterm.ini(file)
- If this value is not a full path, it is understood as a relative path from ttxssh.dll. + If this value is not a full path, it is understood as a relative path from configuration file folder.
/ssh-consume=<file>
After teraterm.ini file is read, it is erased.
- If this value is not a full path, it is understood as a relative path from ttxssh.dll. + If this value is not a full path, it is understood as a relative path from configuration file folder.
/t=<value>
@@ -96,7 +96,7 @@

Options

/keyfile=<file>
your private key file is specified
- When the file name is not the absolute path, the file is identified as the relative path. + If this value is not a full path, it is understood as a relative path from configuration file folder.
/ask4passwd
diff --git a/doc/ja/html/commandline/ttssh.html b/doc/ja/html/commandline/ttssh.html index 09dce4588..e86779b13 100644 --- a/doc/ja/html/commandline/ttssh.html +++ b/doc/ja/html/commandline/ttssh.html @@ -31,19 +31,19 @@

TTSSH command line

/f=<file>
teraterm.init@C(file)ǂݍ
- t@C΃pXłȂƂ́Attxssh.dll ̑΃pXƌȂ܂B + t@C΃pXłȂƂ́Aݒt@CtH_̑΃pXƌȂ܂B
/ssh-f=<file>
teraterm.init@C(file)ǂݍ
- t@C΃pXłȂƂ́Attxssh.dll ̑΃pXƌȂ܂B + t@C΃pXłȂƂ́Aݒt@CtH_̑΃pXƌȂ܂B
/ssh-consume=<file>
teraterm.init@C(file)̓ǂݍ݌AYt@C폜B
- t@C΃pXłȂƂ́Attxssh.dll ̑΃pXƌȂ܂B + t@C΃pXłȂƂ́Aݒt@CtH_̑΃pXƌȂ܂B
/t=<value>
@@ -96,7 +96,7 @@

TTSSH command line

/keyfile=<file>
閧w肷
- t@C΃pXłȂƂ́Attxssh.dll ̑΃pXƌȂ܂B + t@C΃pXłȂƂ́Aݒt@CtH_̑΃pXƌȂ܂B
/ask4passwd
diff --git a/ttssh2/ttxssh/ttxssh.c b/ttssh2/ttxssh/ttxssh.c index 2a750fb96..6097b2f6f 100644 --- a/ttssh2/ttxssh/ttxssh.c +++ b/ttssh2/ttxssh/ttxssh.c @@ -1362,15 +1362,11 @@ static void PASCAL TTXWriteINIFile(const wchar_t *fileName, PTTSet ts) static void read_ssh_options_from_user_file(PTInstVar pvar, const wchar_t *user_file_name) { - if (user_file_name[0] == '.') { - read_ssh_options(pvar, user_file_name); - } else { - wchar_t *fname; + wchar_t *fname; - fname = get_teraterm_dir_relative_nameW(user_file_name); - read_ssh_options(pvar, fname); - free(fname); - } + fname = get_home_dir_relative_nameW(user_file_name); + read_ssh_options(pvar, fname); + free(fname); pvar->settings = *pvar->ts_SSH; FWDUI_load_settings(pvar); @@ -1664,7 +1660,10 @@ static void PASCAL TTXParseParam(wchar_t *param, PTTSet ts, PCHAR DDETopic) WideCharToACP_t(option + 8, pvar->ssh2_password, sizeof(pvar->ssh2_password)); } else if (wcsncmp(option + 1, L"keyfile=", 8) == 0) { - WideCharToACP_t(option + 9, pvar->ssh2_keyfile, sizeof(pvar->ssh2_keyfile)); + wchar_t *keyfileW = option + 9; + keyfileW = get_home_dir_relative_nameW(keyfileW); + WideCharToACP_t(keyfileW, pvar->ssh2_keyfile, sizeof(pvar->ssh2_keyfile)); + free(keyfileW); } else if (wcscmp(option + 1, L"ask4passwd") == 0) { // pX[h𕷂 (2006.9.18 maya) @@ -2068,7 +2067,7 @@ static void about_dlg_set_abouttext(PTInstVar pvar, HWND dlg, digest_algorithm d static void init_about_dlg(PTInstVar pvar, HWND dlg) { - char buf[1024], tmpbuf[128]; + char buf[1024]; static const DlgTextInfo text_info[] = { { 0, "DLG_ABOUT_TITLE" }, { IDC_FP_HASH_ALG, "DLG_ABOUT_FP_HASH_ALGORITHM" }, @@ -2475,8 +2474,7 @@ wchar_t *get_teraterm_dir_relative_nameW(const wchar_t *basename) wchar_t *path; wchar_t *ret; - if (basename[0] == '\\' || basename[0] == '/' - || (basename[0] != 0 && basename[1] == ':')) { + if (!IsRelativePathW(basename)) { return _wcsdup(basename); } @@ -2487,15 +2485,13 @@ wchar_t *get_teraterm_dir_relative_nameW(const wchar_t *basename) return ret; } -void get_teraterm_dir_relative_name(char *buf, int bufsize, - char *basename) +void get_teraterm_dir_relative_name(char *buf, int bufsize, const char *basename) { int filename_start = 0; int i; int ch; - if (basename[0] == '\\' || basename[0] == '/' - || (basename[0] != 0 && basename[1] == ':')) { + if (!IsRelativePathA(basename)) { strncpy_s(buf, bufsize, basename, _TRUNCATE); return; } @@ -2512,16 +2508,14 @@ void get_teraterm_dir_relative_name(char *buf, int bufsize, } } -int copy_teraterm_dir_relative_path(char *dest, int destsize, - char *basename) +int copy_teraterm_dir_relative_path(char *dest, int destsize, const char *basename) { char buf[1024]; int filename_start = 0; int i; int ch, ch2; - if (basename[0] != '\\' && basename[0] != '/' - && (basename[0] == 0 || basename[1] != ':')) { + if (!IsRelativePathA(basename)) { strncpy_s(dest, destsize, basename, _TRUNCATE); return strlen(dest); } diff --git a/ttssh2/ttxssh/ttxssh.h b/ttssh2/ttxssh/ttxssh.h index d52e4ecc6..babe3a9ca 100644 --- a/ttssh2/ttxssh/ttxssh.h +++ b/ttssh2/ttxssh/ttxssh.h @@ -400,9 +400,9 @@ void logprintf(int level, const char *fmt, ...); void logprintf_hexdump(int level, const char *data, int len, const char *fmt, ...); #endif -void get_teraterm_dir_relative_name(char *buf, int bufsize, char *basename); +void get_teraterm_dir_relative_name(char *buf, int bufsize, const char *basename); wchar_t *get_teraterm_dir_relative_nameW(const wchar_t *basename); -int copy_teraterm_dir_relative_path(char *dest, int destsize, char *basename); +int copy_teraterm_dir_relative_path(char *dest, int destsize, const char *basename); wchar_t *get_home_dir_relative_nameW(const wchar_t *basename); wchar_t *get_log_dir_relative_nameW(const wchar_t *basename); int uuencode(unsigned char *src, int srclen, unsigned char *target, int targsize); From 4bfe3b76ca6cbed2eb082f0b21eb76d8539e7f60 Mon Sep 17 00:00:00 2001 From: zmatsuo <6488847+zmatsuo@users.noreply.github.com> Date: Sat, 23 Mar 2024 09:35:51 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=E6=94=B9=E7=89=88=E5=B1=A5=E6=AD=B4?= =?UTF-8?q?=E3=81=AB=E8=BF=BD=E8=A8=98=20#159?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/en/html/about/history.html | 7 ++++--- doc/ja/html/about/history.html | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/doc/en/html/about/history.html b/doc/en/html/about/history.html index 3d5d7c391..fe372f89f 100644 --- a/doc/en/html/about/history.html +++ b/doc/en/html/about/history.html @@ -58,6 +58,7 @@

YYYY.MM.DD (Ver 5.3 not released yet)

  • Misc
    • Added Tamil.lng language file.
    • +
    • Upgraded TTSSH to 3.3.
  • @@ -3477,11 +3478,11 @@

    YYYY.MM.DD (Ver 3.3 not released yet)

    - +

    2024.2.29 (Ver 3.2)

    diff --git a/doc/ja/html/about/history.html b/doc/ja/html/about/history.html index 00102d07f..cb1b8f4b4 100644 --- a/doc/ja/html/about/history.html +++ b/doc/ja/html/about/history.html @@ -58,6 +58,7 @@

    YYYY.MM.DD (Ver 5.3 not released yet)

  • ̑
  • @@ -3473,11 +3474,11 @@

    TTSSH

    YYYY.MM.DD (Ver 3.3 not released yet)

      - +