freebsd-ports/sysutils/u-boot-rpi2/files/patch-common_cmd__test.c
Luiz Otavio O Souza 3156a26503 U-Boot loader and related files for Raspberry Pi 2
To install this bootloader, copy ALL the files in the share/u-boot/u-boot-rpi2
directory to the first partition, formatted as FAT32, on an SD card.

This version is patched so that:
 * ELF and API features are enabled.
 * The default environment is trimmed to just what's needed to boot.
 * The saveenv command writes to the file uboot.env on the FAT partition.

For information about running FreeBSD on RaspberryPi, see
WWW: http://wiki.freebsd.org/FreeBSD/arm/Raspberry%20Pi

For general information about U-Boot see WWW: http://www.denx.de/wiki/U-Boot

Approved by:	garga
2015-04-24 19:40:12 +00:00

19 lines
485 B
C

--- common/cmd_test.c.orig 2014-10-14 08:47:15 UTC
+++ common/cmd_test.c
@@ -65,9 +65,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
{