| 1228 |
*dst = '\0'; |
*dst = '\0'; |
| 1229 |
} |
} |
| 1230 |
|
|
|
// copy from ttermpro/ttset.c (2006.8.21 maya) |
|
|
void Dequote(PCHAR Source, PCHAR Dest) |
|
|
{ |
|
|
int i, j; |
|
|
char q, c; |
|
|
|
|
|
Dest[0] = 0; |
|
|
if (Source[0]==0) return; |
|
|
i = 0; |
|
|
/* quoting char */ |
|
|
q = Source[i]; |
|
|
/* only '"' is used as quoting char */ |
|
|
if (q!='"') |
|
|
q = 0; |
|
|
else |
|
|
i++; |
|
|
|
|
|
c = Source[i]; |
|
|
i++; |
|
|
j = 0; |
|
|
while ((c!=0) && (c!=q)) |
|
|
{ |
|
|
Dest[j] = c; |
|
|
j++; |
|
|
c = Source[i]; |
|
|
i++; |
|
|
} |
|
|
|
|
|
Dest[j] = 0; |
|
|
} |
|
|
|
|
| 1231 |
/* returns 1 if the option text must be deleted */ |
/* returns 1 if the option text must be deleted */ |
| 1232 |
static int parse_option(PTInstVar pvar, char FAR * option) |
static int parse_option(PTInstVar pvar, char FAR * option) |
| 1233 |
{ |
{ |
| 1245 |
strcat(pvar->settings.DefaultForwarding, option + 5); |
strcat(pvar->settings.DefaultForwarding, option + 5); |
| 1246 |
} |
} |
| 1247 |
} else if (MATCH_STR(option + 4, "-f=") == 0) { |
} else if (MATCH_STR(option + 4, "-f=") == 0) { |
| 1248 |
// ファイル名が `"' で囲まれていたら取り出す (2006.8.21 maya) |
read_ssh_options_from_user_file(pvar, option + 7); |
|
char* buf = (char *)calloc(strlen(option), sizeof(char)); |
|
|
Dequote(option + 7, buf); |
|
|
read_ssh_options_from_user_file(pvar, buf); |
|
|
free(buf); |
|
| 1249 |
} else if (MATCH_STR(option + 4, "-v") == 0) { |
} else if (MATCH_STR(option + 4, "-v") == 0) { |
| 1250 |
pvar->settings.LogLevel = LOG_LEVEL_VERBOSE; |
pvar->settings.LogLevel = LOG_LEVEL_VERBOSE; |
| 1251 |
} else if (_stricmp(option + 4, "-autologin") == 0 |
} else if (_stricmp(option + 4, "-autologin") == 0 |
| 1253 |
pvar->settings.TryDefaultAuth = TRUE; |
pvar->settings.TryDefaultAuth = TRUE; |
| 1254 |
|
|
| 1255 |
} else if (MATCH_STR(option + 4, "-consume=") == 0) { |
} else if (MATCH_STR(option + 4, "-consume=") == 0) { |
| 1256 |
// ファイル名が `"' で囲まれていたら取り出す (2006.8.21 maya) |
read_ssh_options_from_user_file(pvar, option + 13); |
|
char* buf = (char *)calloc(strlen(option), sizeof(char)); |
|
|
Dequote(option + 13, buf); |
|
|
read_ssh_options_from_user_file(pvar, buf); |
|
|
free(buf); |
|
| 1257 |
DeleteFile(option + 13); |
DeleteFile(option + 13); |
| 1258 |
|
|
| 1259 |
// /ssh1 と /ssh2 オプションの新規追加 (2006.9.16 maya) |
// /ssh1 と /ssh2 オプションの新規追加 (2006.9.16 maya) |
| 1281 |
pvar->settings.Enabled = 0; |
pvar->settings.Enabled = 0; |
| 1282 |
} |
} |
| 1283 |
} else if (MATCH_STR(option + 1, "f=") == 0) { |
} else if (MATCH_STR(option + 1, "f=") == 0) { |
| 1284 |
// ファイル名が `"' で囲まれていたら取り出す (2006.8.21 maya) |
read_ssh_options_from_user_file(pvar, option + 3); |
|
char* buf = (char *)calloc(strlen(option), sizeof(char)); |
|
|
Dequote(option + 3, buf); |
|
|
read_ssh_options_from_user_file(pvar, buf); |
|
|
free(buf); |
|
| 1285 |
|
|
| 1286 |
// /1 および /2 オプションの新規追加 (2004.10.3 yutaka) |
// /1 および /2 オプションの新規追加 (2004.10.3 yutaka) |
| 1287 |
} else if (MATCH_STR(option + 1, "1") == 0) { |
} else if (MATCH_STR(option + 1, "1") == 0) { |
| 1361 |
static void FAR PASCAL TTXParseParam(PCHAR param, PTTSet ts, |
static void FAR PASCAL TTXParseParam(PCHAR param, PTTSet ts, |
| 1362 |
PCHAR DDETopic) |
PCHAR DDETopic) |
| 1363 |
{ |
{ |
| 1364 |
|
// スペースを含むファイル名を認識するように修正 (2006.10.7 maya) |
| 1365 |
int i; |
int i; |
| 1366 |
BOOL inParam = FALSE; |
BOOL inParam = FALSE; |
| 1367 |
BOOL inQuotes = FALSE; |
BOOL inQuotes = FALSE; |
| 1368 |
|
BOOL inFileParam = FALSE; |
| 1369 |
PCHAR option = NULL; |
PCHAR option = NULL; |
| 1370 |
GET_VAR(); |
GET_VAR(); |
| 1371 |
|
|
| 1374 |
} |
} |
| 1375 |
|
|
| 1376 |
for (i = 0; param[i] != 0; i++) { |
for (i = 0; param[i] != 0; i++) { |
| 1377 |
if (inQuotes ? param[i] == |
if (inQuotes ? param[i] == '"' |
| 1378 |
'"' : (param[i] == ' ' || param[i] == '\t')) { |
: (param[i] == ' ' || param[i] == '\t')) { |
| 1379 |
if (option != NULL) { |
if (option != NULL) { |
| 1380 |
char ch = param[i]; |
char ch = param[i]; |
| 1381 |
|
PCHAR Equal; |
| 1382 |
|
|
| 1383 |
param[i] = 0; |
param[i] = 0; |
| 1384 |
if (parse_option |
Equal = strchr(option, '='); |
| 1385 |
(pvar, *option == '"' ? option + 1 : option)) { |
if (inFileParam && Equal != NULL && *(Equal + 1) == '"') { |
| 1386 |
memset(option, ' ', i + 1 - (option - param)); |
char *buf = (char *)calloc(strlen(option), sizeof(char)); |
| 1387 |
} else { |
strncat(buf, option, Equal - option + 1); |
| 1388 |
param[i] = ch; |
strcat(buf, Equal + 2); |
| 1389 |
|
if (parse_option |
| 1390 |
|
(pvar, *buf == '"' ? buf + 1 : buf)) { |
| 1391 |
|
memset(option, ' ', i + 1 - (option - param)); |
| 1392 |
|
} else { |
| 1393 |
|
param[i] = ch; |
| 1394 |
|
} |
| 1395 |
|
free(buf); |
| 1396 |
|
} |
| 1397 |
|
else { |
| 1398 |
|
if (parse_option |
| 1399 |
|
(pvar, *option == '"' ? option + 1 : option)) { |
| 1400 |
|
memset(option, ' ', i + 1 - (option - param)); |
| 1401 |
|
} else { |
| 1402 |
|
param[i] = ch; |
| 1403 |
|
} |
| 1404 |
} |
} |
| 1405 |
option = NULL; |
option = NULL; |
| 1406 |
} |
} |
| 1407 |
inParam = FALSE; |
inParam = FALSE; |
| 1408 |
inQuotes = FALSE; |
inQuotes = FALSE; |
| 1409 |
|
inFileParam = FALSE; |
| 1410 |
} else if (!inParam) { |
} else if (!inParam) { |
| 1411 |
if (param[i] == '"') { |
if (param[i] == '"') { |
| 1412 |
inQuotes = TRUE; |
inQuotes = TRUE; |
| 1416 |
inParam = TRUE; |
inParam = TRUE; |
| 1417 |
option = param + i; |
option = param + i; |
| 1418 |
} |
} |
| 1419 |
|
} else { |
| 1420 |
|
if (option == NULL) { |
| 1421 |
|
continue; |
| 1422 |
|
} |
| 1423 |
|
if ((option[0] == '-' || option[0] == '/') && |
| 1424 |
|
(MATCH_STR(option + 1, "ssh-f=") == 0 || |
| 1425 |
|
MATCH_STR(option + 1, "ssh-consume=") == 0 || |
| 1426 |
|
MATCH_STR(option + 1, "f=") == 0)) { |
| 1427 |
|
if (param[i] == '"') { |
| 1428 |
|
inQuotes = TRUE; |
| 1429 |
|
} |
| 1430 |
|
inFileParam = TRUE; |
| 1431 |
|
} |
| 1432 |
} |
} |
| 1433 |
} |
} |
| 1434 |
|
|
| 1435 |
if (option != NULL) { |
if (option != NULL) { |
| 1436 |
if (parse_option(pvar, option)) { |
PCHAR Equal = strchr(option, '='); |
| 1437 |
memset(option, ' ', i - (option - param)); |
if (inFileParam && Equal != NULL && *(Equal + 1) == '"') { |
| 1438 |
|
char *buf = (char *)calloc(strlen(option), sizeof(char)); |
| 1439 |
|
strncat(buf, option, Equal - option + 1); |
| 1440 |
|
strcat(buf, Equal + 2); |
| 1441 |
|
if (parse_option |
| 1442 |
|
(pvar, *buf == '"' ? buf + 1 : buf)) { |
| 1443 |
|
memset(option, ' ', i + 1 - (option - param)); |
| 1444 |
|
} |
| 1445 |
|
free(buf); |
| 1446 |
|
} |
| 1447 |
|
else { |
| 1448 |
|
if (parse_option(pvar, option)) { |
| 1449 |
|
memset(option, ' ', i - (option - param)); |
| 1450 |
|
} |
| 1451 |
} |
} |
| 1452 |
} |
} |
| 1453 |
|
|
| 3202 |
|
|
| 3203 |
/* |
/* |
| 3204 |
* $Log: not supported by cvs2svn $ |
* $Log: not supported by cvs2svn $ |
| 3205 |
|
* Revision 1.42 2006/10/06 09:05:59 maya |
| 3206 |
|
* ttermpro の /F パラメータの値にスペースが含まれると、TTSSH の設定内容が読み込まれないバグを修正した。 |
| 3207 |
|
* |
| 3208 |
* Revision 1.41 2006/09/18 06:14:48 maya |
* Revision 1.41 2006/09/18 06:14:48 maya |
| 3209 |
* ポートフォワードしているウインドウから新規接続するとエラーが出る問題を修正した。 |
* ポートフォワードしているウインドウから新規接続するとエラーが出る問題を修正した。 |
| 3210 |
* |
* |