aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils/u-boot-olimex-a20-som-evb/files/patch-cmd_test.c
blob: a16105857d85ad6388224b8f437aaf564da371c2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
--- cmd/test.c.orig	2016-07-11 19:01:01 UTC
+++ cmd/test.c
@@ -56,9 +56,14 @@ static int do_test(cmd_tbl_t *cmdtp, int
 	char * const *ap;
 	int i, op, left, adv, expr, last_expr, last_unop, last_binop;
 
-	/* args? */
-	if (argc < 3)
+	/*
+	 * If no args, that's bogus, return false.
+	 * If op is -z and no other args, answer is Yes, string is empty.
+	 */
+	if (argc < 2)
 		return 1;
+	else if (argc == 2)
+		return !(strcmp(argv[1], "-z") == 0);
 
 #ifdef DEBUG
 	{