All of lore.kernel.org
 help / color / mirror / Atom feed
diff for duplicates of <519EF4AE.60702@redhat.com>

diff --git a/a/1.txt b/N1/1.txt
index 89a5e70..37f0535 100644
--- a/a/1.txt
+++ b/N1/1.txt
@@ -43,3 +43,30 @@ index 4275a84..f957178 100644
 -		fprintf(stdout, "Usage: %s base_file_path\n", argv[0]);
 -		return ret;
 -	}
+-
+ 	while ((opt = getopt(argc, argv, "t")) != -1) {
+ 		switch (opt) {
+ 		case 't':
+ 			check_support++;
+ 			break;
+ 		default:
+-			fprintf(stderr, "Usage: %s [-t] base_file_path\n",
+-				argv[0]);
+-			return ret;
++			usage(argv[0]);
+ 		}
+ 	}
+ 
++	/* should be exactly one arg left, the filename */
++	if (!argv[optind] || argv[optind+1])
++		usage(argv[0]);
++
+ 	base_file_path = (char *)strdup(argv[optind]);
+ 
+ 	ret = test_basic_support();
+
+
+_______________________________________________
+xfs mailing list
+xfs@oss.sgi.com
+http://oss.sgi.com/mailman/listinfo/xfs
diff --git a/a/content_digest b/N1/content_digest
index fc9d32c..73be280 100644
--- a/a/content_digest
+++ b/N1/content_digest
@@ -49,6 +49,33 @@
  "-\tif (argc != 2) {\n"
  "-\t\tfprintf(stdout, \"Usage: %s base_file_path\\n\", argv[0]);\n"
  "-\t\treturn ret;\n"
- "-\t}"
+ "-\t}\n"
+ "-\n"
+ " \twhile ((opt = getopt(argc, argv, \"t\")) != -1) {\n"
+ " \t\tswitch (opt) {\n"
+ " \t\tcase 't':\n"
+ " \t\t\tcheck_support++;\n"
+ " \t\t\tbreak;\n"
+ " \t\tdefault:\n"
+ "-\t\t\tfprintf(stderr, \"Usage: %s [-t] base_file_path\\n\",\n"
+ "-\t\t\t\targv[0]);\n"
+ "-\t\t\treturn ret;\n"
+ "+\t\t\tusage(argv[0]);\n"
+ " \t\t}\n"
+ " \t}\n"
+ " \n"
+ "+\t/* should be exactly one arg left, the filename */\n"
+ "+\tif (!argv[optind] || argv[optind+1])\n"
+ "+\t\tusage(argv[0]);\n"
+ "+\n"
+ " \tbase_file_path = (char *)strdup(argv[optind]);\n"
+ " \n"
+ " \tret = test_basic_support();\n"
+ "\n"
+ "\n"
+ "_______________________________________________\n"
+ "xfs mailing list\n"
+ "xfs@oss.sgi.com\n"
+ http://oss.sgi.com/mailman/listinfo/xfs
 
-588dfe6e8be9730c5ce279a6e13228de2cf5d643268c1df6d52c8c4f4b5b44f6
+28ab2ec45690a3d8595925f15fe4eb23bb68257b9043cbbc528fb4bdca5ea88e

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.