Fix exit status with -f for nonexistent paths
Thanks Michael Forney <mforney@mforney.org> for reporting this!
This commit is contained in:
		| @@ -1,4 +1,5 @@ | |||||||
| /* See LICENSE file for copyright and license details. */ | /* See LICENSE file for copyright and license details. */ | ||||||
|  | #include <errno.h> | ||||||
| #include <stdio.h> | #include <stdio.h> | ||||||
|  |  | ||||||
| #include "../fs.h" | #include "../fs.h" | ||||||
| @@ -16,6 +17,6 @@ rm(const char *path, int unused) | |||||||
| 	if (remove(path) < 0) { | 	if (remove(path) < 0) { | ||||||
| 		if (!rm_fflag) | 		if (!rm_fflag) | ||||||
| 			weprintf("remove %s:", path); | 			weprintf("remove %s:", path); | ||||||
| 		rm_status = 1; | 		rm_status = !(rm_fflag && errno == ENOENT); | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user