mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
When running calibre-portable.exe popup a more useful error message if it is placed in a location with a too long path. Fixes #1866739 [Path length for calibre portable](https://bugs.launchpad.net/calibre/+bug/1866739)
This commit is contained in:
parent
ac12d5933a
commit
f6f418fcb0
@ -85,6 +85,12 @@ LPTSTR get_app_dir() {
|
||||
}
|
||||
|
||||
_sntprintf_s(buf3, BUFSIZE-1, _TRUNCATE, _T("%s%s"), drive, buf2);
|
||||
if (_tcslen(buf3) > 58) {
|
||||
_snwprintf_s(buf, 4*MAX_PATH, _TRUNCATE,
|
||||
L"Path to Calibre Portable (%s) too long. Must be less than 59 characters.", buf3);
|
||||
show_error(buf);
|
||||
ExitProcess(1);
|
||||
}
|
||||
free(buf); free(buf2);
|
||||
return buf3;
|
||||
}
|
||||
@ -150,5 +156,3 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user