Revision: 8048 https://osdn.net/projects/ttssh2/scm/svn/commits/8048 Author: maya Date: 2019-08-31 08:42:17 +0900 (Sat, 31 Aug 2019) Log Message: ----------- 渡された svnversion が存在しない場合に PATH が通っている svnversion を実行するようにした Modified Paths: -------------- trunk/teraterm/svnrev/svnrev.cpp -------------- next part -------------- Modified: trunk/teraterm/svnrev/svnrev.cpp =================================================================== --- trunk/teraterm/svnrev/svnrev.cpp 2019-08-30 15:59:41 UTC (rev 8047) +++ trunk/teraterm/svnrev/svnrev.cpp 2019-08-30 23:42:17 UTC (rev 8048) @@ -41,16 +41,31 @@ // .svn\entries \x82ړǂݍ\x9E\x82ނ̂\xF0\x82\xE2\x82߁A // svnversion.exe \x83R\x83}\x83\x93\x83h\x82\xF0\x8CĂяo\x82\xB5\x82\xBD\x8C\x8B\x89ʂ\xF0\x95Ԃ\xB7 - // _popen \x82̓X\x83y\x81[\x83X\x82\xAA\x8A܂܂\xEA\x82\xE9\x8Fꍇ\x82Ƀ_\x83u\x83\x8B\x83N\x83H\x81[\x83g\x82ň͂\xF1\x82ł\xE0 - // \x82\xA4\x82܂\xAD\x93\xAE\x82\xA9\x82Ȃ\xA2\x82\xBD\x82\xDF 8.3 \x8C`\x8E\xAE\x82ɕϊ\xB7 - DWORD r = GetShortPathName(svnversion, arg1, sizeof(arg1)); - if (r == 0) { - return -1; // svn did not exist + // \x93n\x82\xB3\x82ꂽ svnversion \x82\xAA\x91\xB6\x8D݂\xB7\x82\xEA\x82Ύ\xC0\x8Ds\x82\xB7\x82邪\x81A + // \x82\xBB\x82\xA4\x82łȂ\xAF\x82\xEA\x82\xCE "svnversion" \x82\xF0\x8E\xC0\x8Ds\x82\xB7\x82\xE9 (PATH \x82\xA9\x82猟\x8D\x{142CC2}\xEA\x82\xE9) + if ((fopen_s(&fp, svnversion, "r")) == 0) { + DWORD r; + + fclose(fp); + + // _popen \x82̓X\x83y\x81[\x83X\x82\xAA\x8A܂܂\xEA\x82\xE9\x8Fꍇ\x82Ƀ_\x83u\x83\x8B\x83N\x83H\x81[\x83g\x82ň͂\xF1\x82ł\xE0 + // \x82\xA4\x82܂\xAD\x93\xAE\x82\xA9\x82Ȃ\xA2\x82\xBD\x82\xDF 8.3 \x8C`\x8E\xAE\x82ɕϊ\xB7 + r = GetShortPathName(svnversion, arg1, sizeof(arg1)); + if (r == 0) { + return -1; // svn did not exist + } + GetShortPathName(path, arg2, sizeof(arg2)); + + _snprintf_s(command, sizeof(command), _TRUNCATE, "%s -n %s", arg1, arg2); + } - GetShortPathName(path, arg2, sizeof(arg2)); + else { + GetShortPathName(path, arg2, sizeof(arg2)); - _snprintf_s(command, sizeof(command), _TRUNCATE, "%s -n %s", arg1, arg2); - if ((fp = _popen(command, "rt")) == NULL ) { + _snprintf_s(command, sizeof(command), _TRUNCATE, "hoge -n %s", arg2); + } + + if ((fp = _popen(command, "rt")) == NULL) { return -1; }