mirror of
https://github.com/pbatard/rufus.git
synced 2025-06-08 10:22:30 -04:00
parent
3177e70e25
commit
a354178239
2 changed files with 16 additions and 11 deletions
17
src/rufus.c
17
src/rufus.c
|
@ -3498,14 +3498,19 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
|||
// No need to reprocess that option
|
||||
break;
|
||||
case 'i':
|
||||
if (_access(optarg, 0) != -1) {
|
||||
safe_free(image_path);
|
||||
image_path = calloc(1, MAX_PATH);
|
||||
if (image_path == NULL)
|
||||
break;
|
||||
IGNORE_RETVAL(_chdirU(app_dir));
|
||||
IGNORE_RETVAL(GetFullPathNameU(optarg, MAX_PATH, image_path, NULL));
|
||||
// FILE_ATTRIBUTE_DIRECTORY is set for both dir and access error
|
||||
if (GetFileAttributesU(image_path) & FILE_ATTRIBUTE_DIRECTORY) {
|
||||
printf("Could not find image '%s'\n", image_path);
|
||||
safe_free(image_path);
|
||||
image_path = safe_strdup(optarg);
|
||||
img_provided = TRUE;
|
||||
}
|
||||
else {
|
||||
printf("Could not find ISO image '%s'\n", optarg);
|
||||
break;
|
||||
}
|
||||
img_provided = TRUE;
|
||||
break;
|
||||
case 'l':
|
||||
if (isdigitU(optarg[0])) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue