touch: accept and ignore -f
authorDenis Vlasenko <vda.linux@googlemail.com>
Wed, 28 Nov 2007 19:25:32 +0000 (19:25 -0000)
committerDenis Vlasenko <vda.linux@googlemail.com>
Wed, 28 Nov 2007 19:25:32 +0000 (19:25 -0000)
coreutils/touch.c

index 1b83dc4..3fe8b64 100644 (file)
@@ -26,8 +26,9 @@ int touch_main(int argc, char **argv)
 {
        int fd;
        int status = EXIT_SUCCESS;
-       int flags = getopt32(argv, "c");
+       int flags = getopt32(argv, "cf");
 
+       flags &= 1; /* ignoring -f (BSD compat thingy) */
        argv += optind;
 
        if (!*argv) {