- 12 6月, 2014 1 次提交
-
-
由 Jeroen Hofstee 提交于
Clang interpretes an if condition like "if ((a = b) == NULL) as it tries to assign a value in a statement. Hence if you do "if ((something)) it warns you that you might be confused. Hence drop the double braces for plane if statements. Simon Glass <sjg@chromium.org> Signed-off-by: NJeroen Hofstee <jeroen@myspectrum.nl>
-
- 06 6月, 2014 1 次提交
-
-
由 Simon Glass 提交于
When a simple command like 'false' is provided, hush should return the result of that command. However, hush only does this if the FLAG_EXIT_FROM_LOOP flag is provided. Without this flag, hush will happily execute the empty string command immediate after 'false' and then return a success code. This behaviour does not seem very useful, and requiring the flag also seems wrong, since it means that hush will execute only the first command in a sequence. Add a check for empty string and fall out of the loop in that case. That at least fixes the simple command case. This is a change in behaviour but it is unlikely that the old behaviour would be considered correct in any case. Reported-by: NStefan Herbrechtsmeier <stefan@herbrechtsmeier.net> Signed-off-by: NSimon Glass <sjg@chromium.org>
-
- 30 5月, 2014 5 次提交
-
-
由 Simon Glass 提交于
Add a bootretry_ prefix to these two functions, and remove the need for the #ifdef around everything (it moves to the Makefile). Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
This code is only used by one board, so it seems a shame to clutter up the readline code with it. Move it into its own file. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
This makes it clear where the code resides. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
Move the CLI prototypes from common.h to cli.h as part of an effort to reduce the size of common.h. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
Hush is a command-line interpreter, so rename it to make that clearer. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
- 13 5月, 2014 1 次提交
-
-
由 Kristian Otnes 提交于
console_buffer array is defined to be CONFIG_SYS_CBSIZE + 1 long, whereas the_command array only CONFIG_SYS_CBSIZE long. Subsequent use of strcpy(the_command, console_buffer) will write final \0 terminating byte outside the_command array when entering a command of max length. Signed-off-by: Kristian Otnes <kotnes <at> cisco <dot> com>
-
- 07 3月, 2014 1 次提交
-
-
由 Stephen Warren 提交于
The following shell command fails: if test -z "$x"; then echo "zero"; else echo "non-zero"; fi (assuming $x does not exist, it prints "non-zero" rather than "zero"). ... since "$x" expands to nothing, and the argument is completely dropped, causing too few to be passed to -z, causing cmd_test() to error out early. This is because when variable expansions are processed by make_string(), the expanded results are concatenated back into a new string. However, no quoting is applied when doing so, so any empty variables simply don't generate any parameter when the combined string is parsed again. Fix this by explicitly replacing quoting any argument that was originally quoted when re-generating a string from the already-parsed argument list. This also fixes loss of whitespace in commands such as: setenv space " " setenv var " 1${space}${space} 2 " echo ">>${var}<<" Reported-by: NRussell King <linux@arm.linux.org.uk> Acked-by: NSimon Glass <sjg@chromium.org> Signed-off-by: NStephen Warren <swarren@wwwdotorg.org>
-
- 24 7月, 2013 1 次提交
-
-
由 Wolfgang Denk 提交于
Signed-off-by: NWolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by: NTom Rini <trini@ti.com>
-
- 04 2月, 2013 1 次提交
-
-
由 Richard Genoud 提交于
As far as every arch has a get_timer function, run_command_and_time_it code can now disappear. Signed-off-by: NRichard Genoud <richard.genoud@gmail.com> Acked-By: NChe-Liang Chiou <clchiou@chromium.org> [trini: s/ulong/unsigned long/ in command.h portion] Signed-off-by: NTom Rini <trini@ti.com>
-
- 05 11月, 2012 1 次提交
-
-
由 Kim Phillips 提交于
command.c:44:38: error: bad constant expression dlmalloc.c:1468:2: warning: Using plain integer as NULL pointer dlmalloc.c:1468:5: warning: Using plain integer as NULL pointer dlmalloc.c:2176:12: warning: Using plain integer as NULL pointer dlmalloc.c:2179:31: warning: Using plain integer as NULL pointer dlmalloc.c:2382:14: warning: Using plain integer as NULL pointer dlmalloc.c:2436:14: warning: Using plain integer as NULL pointer dlmalloc.c:2582:31: warning: Using plain integer as NULL pointer dlmalloc.c:2585:17: warning: Using plain integer as NULL pointer dlmalloc.c:2646:14: warning: Using plain integer as NULL pointer dlmalloc.c:2659:19: warning: Using plain integer as NULL pointer dlmalloc.c:2692:19: warning: Using plain integer as NULL pointer dlmalloc.c:2707:19: warning: Using plain integer as NULL pointer dlmalloc.c:2708:14: warning: Using plain integer as NULL pointer dlmalloc.c:2786:31: warning: Using plain integer as NULL pointer dlmalloc.c:2801:12: warning: Using plain integer as NULL pointer dlmalloc.c:2801:22: warning: Using plain integer as NULL pointer dlmalloc.c:2926:27: warning: Using plain integer as NULL pointer dlmalloc.c:2928:14: warning: Using plain integer as NULL pointer dlmalloc.c:2929:12: warning: Using plain integer as NULL pointer dlmalloc.c:3075:14: warning: Using plain integer as NULL pointer hush.c:292:14: warning: symbol 'last_return_code' was not declared. Should it be static? hush.c:293:5: warning: symbol 'nesting_level' was not declared. Should it be static? hush.c:2175:20: warning: Using plain integer as NULL pointer hush.c:2175:34: warning: Using plain integer as NULL pointer hush.c:2210:41: warning: Using plain integer as NULL pointer hush.c:2216:45: warning: Using plain integer as NULL pointer hush.c:2249:25: warning: Using plain integer as NULL pointer hush.c:2332:13: warning: symbol 'new_pipe' was not declared. Should it be static? hush.c:2390:5: warning: symbol 'reserved_word' was not declared. Should it be static? hush.c:2927:5: warning: symbol 'parse_stream' was not declared. Should it be static? hush.c:3127:6: warning: symbol 'mapset' was not declared. Should it be static? hush.c:3133:6: warning: symbol 'update_ifs_map' was not declared. Should it be static? hush.c:3161:5: warning: symbol 'parse_stream_outer' was not declared. Should it be static? hush.c:3295:34: warning: Using plain integer as NULL pointer hush.c:3631:5: warning: symbol 'do_showvar' was not declared. Should it be static image.c:1282:29: warning: Using plain integer as NULL pointer image.c:1315:41: warning: Using plain integer as NULL pointer image.c:1330:25: warning: Using plain integer as NULL pointer image.c:1706:25: warning: Using plain integer as NULL pointer main.c:510:10: warning: symbol 'hist_num' was not declared. Should it be static? main.c:512:5: warning: symbol 'hist_list' was not declared. Should it be static? main.c:513:6: warning: symbol 'hist_lines' was not declared. Should it be static? usb_storage.c:195:6: warning: symbol 'usb_show_progress' was not declared. Should it be static? usb_storage.c:440:48: warning: Using plain integer as NULL pointer usb_storage.c:503:5: warning: symbol 'usb_stor_BBB_comdat' was not declared. Should it be static? usb_storage.c:551:5: warning: symbol 'usb_stor_CB_comdat' was not declared. Should it be static? usb_storage.c:629:55: warning: Using plain integer as NULL pointer usb_storage.c:620:5: warning: symbol 'usb_stor_CBI_get_status' was not declared. Should it be static? usb_storage.c:675:43: warning: Using plain integer as NULL pointer usb_storage.c:668:5: warning: symbol 'usb_stor_BBB_clear_endpt_stall' was not declared. Should it be static? usb_storage.c:679:5: warning: symbol 'usb_stor_BBB_transport' was not declared. Should it be static? usb_storage.c:801:5: warning: symbol 'usb_stor_CB_transport' was not declared. Sh xyzModem.c:104:1: warning: symbol 'CYGACC_COMM_IF_GETC_TIMEOUT' was not declared. Should it be static? xyzModem.c:122:1: warning: symbol 'CYGACC_COMM_IF_PUTC' was not declared. Should it be static? xyzModem.c:169:1: warning: symbol 'parse_num' was not declared. Should it be stat note: hush.c's nesting_level deleted because not used. Signed-off-by: NKim Phillips <kim.phillips@freescale.com>
-
- 03 9月, 2012 2 次提交
-
-
由 Joe Hershberger 提交于
When a variable which contains a user-supplied value is dereferenced (e.g. to be echo'ed), make sure that the value is not further parsed by hush. Set the hush local variable "HUSH_NO_EVAL=1" to enable this behavior. Without this patch, a sequence like this occurs: Panda # env set my_user_string Bob\'s favorite device Panda # print my_user_string my_user_string=Bob's favorite device Panda # echo $my_user_string syntax error hush.c:3007 With this patch, it looks like this: Panda # HUSH_NO_EVAL=1 Panda # env set my_user_string Bob\'s favorite device Panda # print my_user_string my_user_string=Bob's favorite device Panda # echo $my_user_string Bob's favorite device Signed-off-by: NJoe Hershberger <joe.hershberger@ni.com>
-
由 Joe Hershberger 提交于
Use standard sh syntax: ${VAR:-default} Use default value: if VAR is set and non-null, expands to $VAR. Otherwise, expands to default. ${VAR:=default} Set default value: if VAR is set and non-null, expands to $VAR. Otherwise, sets hush VAR to default and expands to default. ${VAR:+default} If VAR is set and non-null, expands to the empty string. Otherwise, expands to default. Signed-off-by: NJoe Hershberger <joe.hershberger@ni.com>
-
- 21 6月, 2012 1 次提交
-
-
由 Tom Rini 提交于
Exactly one board has defined CONFIG_SYS_PROMPT_HUSH_PS2 to a value different than "> " which is vision2. I have Cc'd the maintainer here as I strongly suspect this is a bug rather than intentional behavior. Cc: Stefano Babic <sbabic@denx.de> Signed-off-by: NTom Rini <trini@ti.com> Acked-by: NStefano Babic <sbabic@denx.de>
-
- 07 3月, 2012 3 次提交
-
-
由 Simon Glass 提交于
We currently have the same code in hush.c and main.c. This brings the code into one place. As an added feature, if the command function returns CMD_RET_USAGE then cmd_process() will print a usage message for the command before returning the standard failure code of 1. ARM code size increases about 32 bytes with this clean-up. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
There is a nasty interleave of #ifdefs in hush.c where the two code paths have different indents. Remove this ickiness. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
We should aim for a single point of entry to the commands, whichever parser is used. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
- 22 11月, 2011 1 次提交
-
-
由 Igor Grinberg 提交于
Extract all extern declarations for console_buffer[] out of c files into the common.h header. Signed-off-by: NIgor Grinberg <grinberg@compulab.co.il> Cc: Frank Gottschling <fgottschling@eltec.de> Cc: Murray Jensen <Murray.Jensen@csiro.au>
-
- 27 10月, 2011 1 次提交
-
-
由 Simon Glass 提交于
This function is generally useful and shouldn't hide away in hush. It has been moved as is. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
- 18 10月, 2011 1 次提交
-
-
由 Jason Hobbs 提交于
Signed-off-by: NJason Hobbs <jason.hobbs@calxeda.com> Cc: Mike Frysinger <vapier@gentoo.org> Acked-by: NMike Frysinger <vapier@gentoo.org>
-
- 11 5月, 2011 1 次提交
-
-
由 Holger Brunck 提交于
Signed-off-by: NHolger Brunck <holger.brunck@keymile.com> Acked-by: NHeiko Schocher <hs@denx.de> cc: Wolfgang Denk <wd@denx.de> cc: Detlev Zundel <dzu@denx.de> cc: Valentin Longchamp <valentin.longchamp@keymile.com> Signed-off-by: NValentin Longchamp <valentin.longchamp@keymile.com>
-
- 29 11月, 2010 2 次提交
-
-
由 Mike Frysinger 提交于
The duplication of the do_reset prototype has gotten out of hand, and they're not all in sync. Unify them all in command.h. Signed-off-by: NMike Frysinger <vapier@gentoo.org>
-
由 Mike Frysinger 提交于
Signed-off-by: NMike Frysinger <vapier@gentoo.org>
-
- 30 10月, 2010 1 次提交
-
-
由 Wolfgang Denk 提交于
By now, the majority of architectures have working relocation support, so the few remaining architectures have become exceptions. To make this more obvious, we make working relocation now the default case, and flag the remaining cases with CONFIG_NEEDS_MANUAL_RELOC. Signed-off-by: NWolfgang Denk <wd@denx.de> Tested-by: NHeiko Schocher <hs@denx.de> Tested-by: NReinhard Meyer <u-boot@emk-elektronik.de>
-
- 25 7月, 2010 1 次提交
-
-
由 Wolfgang Denk 提交于
Lots of code use this construct: cmd_usage(cmdtp); return 1; Change cmd_usage() let it return 1 - then we can replace all these ocurrances by return cmd_usage(cmdtp); This fixes a few places with incorrect return code handling, too. Signed-off-by: NWolfgang Denk <wd@denx.de>
-
- 05 7月, 2010 1 次提交
-
-
由 Wolfgang Denk 提交于
The hush shell dynamically allocates (and re-allocates) memory for the argument strings in the "char *argv[]" argument vector passed to commands. Any code that modifies these pointers will cause serious corruption of the malloc data structures and crash U-Boot, so make sure the compiler can check that no such modifications are being done by changing the code into "char * const argv[]". This modification is the result of debugging a strange crash caused after adding a new command, which used the following argument processing code which has been working perfectly fine in all Unix systems since version 6 - but not so in U-Boot: int main (int argc, char **argv) { while (--argc > 0 && **++argv == '-') { /* ====> */ while (*++*argv) { switch (**argv) { case 'd': debug++; break; ... default: usage (); } } } ... } The line marked "====>" will corrupt the malloc data structures and usually cause U-Boot to crash when the next command gets executed by the shell. With the modification, the compiler will prevent this with an error: increment of read-only location '*argv' N.B.: The code above can be trivially rewritten like this: while (--argc > 0 && **++argv == '-') { char *arg = *argv; while (*++arg) { switch (*arg) { ... Signed-off-by: NWolfgang Denk <wd@denx.de> Acked-by: NMike Frysinger <vapier@gentoo.org>
-
- 30 6月, 2010 2 次提交
-
-
由 Remy Bohmer 提交于
The console_buffer size is declared in common/main.c as -- char console_buffer[CONFIG_SYS_CBSIZE + 1]; so this extern definition is wrong. Signed-off-by: NRemy Bohmer <linux@bohmer.net>
-
由 Remy Bohmer 提交于
The console_buffer size is declared in common/main.c as -- char console_buffer[CONFIG_SYS_CBSIZE + 1]; so this extern definition is wrong. Signed-off-by: NRemy Bohmer <linux@bohmer.net>
-
- 03 10月, 2009 1 次提交
-
-
由 Peter Tyser 提交于
Add #ifdefs where necessary to not perform relocation fixups. This allows boards/architectures which support relocation to trim a decent chunk of code. Note that this patch doesn't add #ifdefs to architecture-specific code which does not support relocation. Signed-off-by: NPeter Tyser <ptyser@xes-inc.com>
-
- 10 8月, 2009 1 次提交
-
-
由 Peter Tyser 提交于
An off-by-one error in hush.c resulted in an unintentional free() call every time a command was executed Signed-off-by: NPeter Tyser <ptyser@xes-inc.com>
-
- 13 6月, 2009 1 次提交
-
-
由 Wolfgang Denk 提交于
Many of the help messages were not really helpful; for example, many commands that take no arguments would not print a correct synopsis line, but "No additional help available." which is not exactly wrong, but not helpful either. Commit ``Make "usage" messages more helpful.'' changed this partially. But it also became clear that lots of "Usage" and "Help" messages (fields "usage" and "help" in struct cmd_tbl_s respective) were actually redundant. This patch cleans this up - for example: Before: => help dtt dtt - Digital Thermometer and Thermostat Usage: dtt - Read temperature from digital thermometer and thermostat. After: => help dtt dtt - Read temperature from Digital Thermometer and Thermostat Usage: dtt Signed-off-by: NWolfgang Denk <wd@denx.de>
-
- 12 2月, 2009 1 次提交
-
-
由 Mike Frysinger 提交于
Move global '#ifdef CONFIG_xxx .... #endif' out of the .c files and into the COBJS-$(CONFIG_xxx) in the Makefile. Also delete unused var in kgdb code in the process. Signed-off-by: NMike Frysinger <vapier@gentoo.org>
-
- 28 1月, 2009 2 次提交
-
-
由 Peter Tyser 提交于
Remove command name from all command "usage" fields and update common/command.c to display "name - usage" instead of just "usage". Also remove newlines from command usage fields. Signed-off-by: NPeter Tyser <ptyser@xes-inc.com>
-
由 Peter Tyser 提交于
Signed-off-by: NPeter Tyser <ptyser@xes-inc.com>
-
- 19 10月, 2008 2 次提交
-
-
Signed-off-by: NJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
-
由 Heiko Schocher 提交于
This new command shows the local variables defined in the hush shell: => help showvar showvar - print values of all hushshell variables showvar name ... - print value of hushshell variable 'name' Also make the set_local_var() and unset_local_var () no longer static, so it is possible to define local hush shell variables at boot time. If CONFIG_HUSH_INIT_VAR is defined, u-boot calls hush_init_var (), where boardspecific code can define local hush shell variables at boottime. Signed-off-by: NHeiko Schocher <hs@denx.de>
-
- 21 8月, 2008 1 次提交
-
-
由 Stefan Roese 提交于
This patch changes the debug_printf() marco for U-Boot in hush.c and moves the definition of DEBUG_SHELL to a place that is actually compiled under U-Boot. Signed-off-by: NStefan Roese <sr@denx.de>
-
- 14 7月, 2008 1 次提交
-
-
由 Wolfgang Denk 提交于
Signed-off-by: NWolfgang Denk <wd@denx.de>
-
- 21 5月, 2008 1 次提交
-
-
由 Wolfgang Denk 提交于
This commit gets rid of a huge amount of silly white-space issues. Especially, all sequences of SPACEs followed by TAB characters get removed (unless they appear in print statements). Also remove all embedded "vim:" and "vi:" statements which hide indentation problems. Signed-off-by: NWolfgang Denk <wd@denx.de>
-