mirror of
https://github.com/facebook/zstd.git
synced 2025-08-05 19:15:58 +03:00
fix confirmation prompt
This commit is contained in:
@@ -225,7 +225,6 @@ static int FIO_getFiles(FILE** fileOutPtr, FILE** fileInPtr,
|
|||||||
if (*fileOutPtr != 0)
|
if (*fileOutPtr != 0)
|
||||||
{
|
{
|
||||||
/* prompt for overwrite authorization */
|
/* prompt for overwrite authorization */
|
||||||
int ch = 'N';
|
|
||||||
fclose(*fileOutPtr);
|
fclose(*fileOutPtr);
|
||||||
DISPLAY("Warning : %s already exists \n", dstFileName);
|
DISPLAY("Warning : %s already exists \n", dstFileName);
|
||||||
if ((g_displayLevel <= 1) || (*fileInPtr == stdin))
|
if ((g_displayLevel <= 1) || (*fileInPtr == stdin))
|
||||||
@@ -235,11 +234,14 @@ static int FIO_getFiles(FILE** fileOutPtr, FILE** fileInPtr,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
DISPLAY("Overwrite ? (y/N) : ");
|
DISPLAY("Overwrite ? (y/N) : ");
|
||||||
while((ch = getchar()) != '\n' && ch != EOF); /* flush integrated */
|
|
||||||
if ((ch!='Y') && (ch!='y'))
|
|
||||||
{
|
{
|
||||||
DISPLAY("No. Operation aborted : %s already exists \n", dstFileName);
|
int ch = getchar();
|
||||||
return 1;
|
if ((ch!='Y') && (ch!='y'))
|
||||||
|
{
|
||||||
|
DISPLAY("No. Operation aborted : %s already exists \n", dstFileName);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
while ((ch!=EOF) && (ch!='\n')) ch = getchar(); /* flush rest of input line */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user