| 471 | } |
| 472 | |
| 473 | TCHAR * Ext2BuildCMDA() |
| 474 | { |
| 475 | TCHAR cmd[512] = {0}, *p, *refresh = NULL; |
| 476 | int len = 0; |
| 477 | |
| 478 | if (GetModuleFileName(NULL, cmd, 510)) { |
| 479 | } else { |
| 480 | strcpy(cmd, GetCommandLine()); |
| 481 | } |
| 482 | |
| 483 | len = (int)_tcslen(cmd) + 2; |
| 484 | refresh = new TCHAR[len]; |
| 485 | if (!refresh) |
| 486 | goto errorout; |
| 487 | memset(refresh, 0, sizeof(TCHAR)*len); |
| 488 | _tcscpy(refresh, cmd); |
| 489 | p = _tcsstr(refresh, _T("/")); |
| 490 | if (p) |
| 491 | *p = 0; |
| 492 | |
| 493 | p = Ext2StrLastA(refresh, "Ext2Mgr"); |
| 494 | if (p) { |
| 495 | p[4] = 'S'; |
| 496 | p[5] = 'r'; |
| 497 | p[6] = 'v'; |
| 498 | } else { |
| 499 | delete [] refresh; |
| 500 | refresh = NULL; |
| 501 | } |
| 502 | |
| 503 | errorout: |
| 504 | return refresh; |
| 505 | } |
| 506 | |
| 507 | WCHAR *Ext2StrLastW(WCHAR *t, WCHAR *s) |
| 508 | { |
no test coverage detected