Fixed confirmation
This commit is contained in:
parent
45dd4ecf49
commit
80cd9078de
3
src/rm.c
3
src/rm.c
@ -39,11 +39,12 @@ static int _rm_error(char * message, int ret)
|
||||
static int _rm_confirm(char * message)
|
||||
{
|
||||
int c;
|
||||
int tmp;
|
||||
|
||||
fprintf(stderr, "%s%s%s", "rm: Remove file \"", message, "\"? ");
|
||||
if((c = fgetc(stdin)) == EOF)
|
||||
return _rm_error("stdin", 0);
|
||||
fflush(stdin);
|
||||
while(c != '\n' && (tmp = fgetc(stdin)) != EOF && tmp != '\n');
|
||||
return c == 'y';
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user