summaryrefslogtreecommitdiff
path: root/com32/hdt/hdt-cli.c
Commit message (Collapse)AuthorAgeFilesLines
* hdt: Avoid false-positive single command detectionErwan Velu2015-09-041-2/+2
| | | | | | | | | | | | | | | Since commit 1697594b61f9a8f9d092996afc0e2c80bbb2a20a, some commands are said to be "nomodule" like "say". This patch was adding a check if the nomodule flag was set but didn't checked that the associated structure did exist leading to false positive detection. As a result, the commands were not executed meaning the CLI was unsuable since ... 3 years.... *shame* This commit simply avoid considering the nomodule flag if the structure is not allocated
* hdt: Fixing argv usage to avoid crashErwan Velu2015-09-041-5/+5
| | | | | | | argv shall be passed as a pointer to avoid a crash when running command like "dmi". Thanks genec for pointing this out.
* hdt: fix sizeof(char *) misuseJonathan Boeing2015-05-031-3/+2
| | | | | | | | | | | | The code was passing sizeof(const char *) - not the length of the string or the size of the buffer - as the length to strncmp(). These two cases don't need the length, so switch to strcmp. Fixes the warning: argument to 'sizeof' in 'strncmp' call is the same expression as the second source; did you mean to provide an explicit length? Signed-off-by: Jonathan Boeing <jonathan.n.boeing@gmail.com>
* hdt: Fixing memory leak in cliFelipe Pena2014-01-291-0/+2
| | | | | | | The dynamically alloc'd string to protect from strtok modification has not been free'd on start_auto_mode() function. This patch insure the free is done properly.
* hdt-cli: Correct malloc() size argumentMatt Fleming2012-11-271-1/+1
| | | | | | | | We need to be allocating sizeof(char *) (4) not sizeof(char) (1) for 'new_argv'. Cc: Erwan Velu <erwanaliasr1@gmail.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* hdt: Removing remaining printf()Erwan Velu2012-09-101-9/+9
| | | | Using more_printf allow to manage more easily several pages printing.
* hdt: Adding nomodule support in cliErwan Velu2012-05-271-4/+25
| | | | | | | | | | Some new commands might need being able to manage the argv directly instead of the much more oriented scheme we had until now. This commit add a .nomodule option to cli object to explically tell they don't have a module as parameter but only arguments. This will be needed for the 'say' command.
* hdt: Fixing argument mgmt in cliErwan Velu2012-05-271-2/+2
| | | | Sizeof(char *) is definetly wrong for getting the length of a string.
* hdt: Adding more debug traces in cliErwan Velu2012-05-271-6/+8
| | | | | Adding more debug traces in the cli management to ease debugging & feature adding.
* hdt: Showing specific message for auto modeErwan Velu2011-04-201-2/+1
| | | | | That's a nice info to know that some output were generated by the automatic mode.
* Merge branch 'master' into chouffeErwan Velu2011-01-251-13/+16
|\ | | | | | | | | Conflicts: com32/hdt/hdt.h
| * Replacing strncpy by strlcpyErwan Velu2010-06-221-12/+12
| | | | | | | | | | As reported by hpa, strlcpy is safer and could prevent some bugs. So I replaced all strncpy by strlcpy calls.
| * hdt-cli.c: clean up unused warningsH. Peter Anvin2010-05-121-1/+4
| | | | | | | | | | | | -Werror cleanup. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* | Merge branch 'master', remote branch 'origin' into chouffeErwan Velu2010-05-261-3/+3
|\ \ | |/
| * hdt: Fixing print_history() prototypeErwan Velu2010-05-121-1/+1
| | | | | | | | print_history have to follow the exec prototype
| * Change () prototypes to (void)H. Peter Anvin2010-01-061-3/+3
| | | | | | | | | | | | | | | | () means the same as (...) in C, not the same as (void) as it does in C++. It is generally misused to mean (void), though. Actually write what we mean... this is C, after all. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | hdt: Unique hardware detection pathErwan Velu2009-12-071-10/+0
| | | | | | | | | | | | Impact: Hardware detection path is simplified Hardware is detected once, at boot time
* | hdt: Adding basic ACPI modeErwan Velu2009-12-041-3/+5
| | | | | | | | | | | | Impact: new acpi mode Adding a new ACPI mode, still lots of work to do
* | acpi: Fixing parsingErwan Velu2009-12-041-4/+1
| | | | | | | | | | | | | | Impact: none Parsing have to be done the spec says ;) Let's found the RSDP first
* | acpi: Initial stuff to find madtErwan Velu2009-12-041-0/+7
|/ | | | | | Impact: adding madt stuff Trying to add some madt stuff
* hdt: Fixing history cyclingErwan Velu2009-12-041-8/+20
| | | | | | Impact: prior to that commit, cycling the history failed When we enter more than 32 commands, let's cycle the history
* hdt: print_history have to use more_printfErwan Velu2009-12-041-2/+3
| | | | | | Impact: managing scrolling in history() History can generates some scrolling, so let's use more_printf
* hdt: Fixing history behavior to match bash's oneErwan Velu2009-12-041-13/+27
| | | | | | Impact: history usage is more obvious History (up/down) is more intiutive and copy bash's behavior
* hdt: Adding history commandErwan Velu2009-12-041-1/+0
| | | | | | Impact: new command 'history' This command allow to see the content of the history
* hdt: reworking history to prevent corruptionErwan Velu2009-12-041-52/+58
| | | | | | Impact: avoid history corruption No need to copy history to input. We can directly use the history stack.
* hdt: Running NindentErwan Velu2009-11-241-856/+836
| | | | | | Impact: Visual cleanup HDT now uses the same indent as syslinux
* hdt: fix memory corruption in the CLIPierre-Alexandre Meyer2009-11-231-94/+100
| | | | | | | | | | More memory corruption with overlooked. parse_command_line and expand_aliases both allocate memory (for command, module, argc and argv). We did fix the memory corruption for the autocompletion feature but but didn't do it for the actual execution of the commands. Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
* hdt: trivial printf fix (CLI)Pierre-Alexandre Meyer2009-11-181-1/+1
| | | | | | Remove a typo. This fixes a compilation warning. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* hdt: more memory corruption fixesPierre-Alexandre Meyer2009-11-181-14/+26
| | | | | | | | A cli_module_descr can be defined with no modules (only a default callback). Cf. the syslinux module for instance. This patch adds a check for NULL structures before trying to dereference them. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* hdt: fix memory corruption in CLIPierre-Alexandre Meyer2009-11-181-10/+13
| | | | | | | Ralf Carl has reported some corruption in the autocompletion feature of the CLI. This patch fixes it. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* hdt: Fixing building warningErwan Velu2009-11-081-1/+2
| | | | | | Impact: Avoid warning during compilation Avoid warning during gcc compilation
* hdt: Putting auto mode in coherence with cliErwan Velu2009-11-051-6/+5
| | | | | | | Impact: visual The output generated by the auto mode should stay in coherence with the default cli mode.
* hdt: Switching debug mode in quiet modeErwan Velu2009-11-051-3/+3
| | | | | | Impact: "quiet" keyword also a quiet display quiet is a new keyword to prevent HDT beeing too much verbose
* Merge remote branch 'pam/hdt-0.3.5'Erwan Velu2009-11-051-4/+9
|\
| * hdt: add debug optionPierre-Alexandre Meyer2009-11-041-4/+9
| | | | | | | | | | | | | | | | | | | | Pass 'debug' on the kernel command line for the output to be more verbose. Making hdt quiet is really helpful in auto mode, when a lot of information is flowing. This fixes #21. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* | hdt: Prevent auto mode from using empty commandsErwan Velu2009-11-051-1/+1
|/ | | | | | Impact: prevent running stupid commands The code didn't prevents from executing stupid "'" commands
* hdt: Removing debugging message in auto modeErwan Velu2009-11-041-1/+0
| | | | | | Impact: Visual This debugging info isn't interesting
* hdt: Improving readbility of auto modeErwan Velu2009-11-041-5/+14
| | | | | | Impact: Visual This patch enhance the readibility of the auto mode
* hdt: Improving automatic code (memory mgmt)Erwan Velu2009-11-031-9/+16
| | | | | | | Impact: Freeing memory We have to be more careful about the malloc & free. We also have to remove spaces around commands
* hdt: Adding automatic modeErwan Velu2009-11-031-0/+28
| | | | | | | | | | | | | | | | | | | | Impact: HDT can be controlled via the cmdline When the auto= parameter is set, HDT execute a set of commands and return to the cli after. i.e auto='show summary; show pci' will show the summary then the pci and return to the cli. Note that the auto= feature, requires a the "'" char to define the complete set of commands and the ";" char to separate commands. Some more examples: auto='show syslinux; exit' -> this will show the syslinux release and then exit to return to the bootloader auto='show summary; reboot' -> this will show the summary and then reboot the computer
* Merge branch 'cmenu-video' into hdt-nextPierre-Alexandre Meyer2009-09-071-1/+0
|\ | | | | | | | | | | | | | | Conflicts: com32/hdt/hdt-cli-disk.c com32/hdt/hdt-common.c Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
| * gpllib: add a new ansi libraryPierre-Alexandre Meyer2009-09-011-1/+0
| | | | | | | | | | | | | | | | | | | | HDT and cmenu are currently duplicating code: they both define their own mini ansi library. This patch extracts the HDT ansi lib into gpllib as a first step towards unification. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* | hdt: fix hdt-cli.c compilation warningPierre-Alexandre Meyer2009-09-011-2/+2
|/ | | | | | We are missing a const qualifier. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* Merge branch 'for-erwan' of ↵Erwan Velu2009-05-031-0/+6
|\ | | | | | | ssh://terminus.zytor.com//pub/git/users/pam/hdt-pierre
| * hdt: Add memory mode (CLI)Pierre-Alexandre Meyer2009-05-021-0/+6
| | | | | | | | | | | | | | The memory mode will be used to dump the memory map (via e820, e802, e801 and 88). Only `show e820' is implemented. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* | hdt: fixing cursor disapearingErwan Velu2009-05-031-3/+3
| | | | | | | | | | | | | | Impact: Improve user experience After some commands, the cursor was disapearing. That could confuse users. This commit resolve this weird cases.
* | hdt: Input cursor is now blinkingErwan Velu2009-05-031-1/+8
| | | | | | | | | | | | | | | | Impact: Improve user experience This commit let the cursor blinking while waiting for a keyboard input. The blinking mode seems to fails under qemu but works fine on real hardware.
* | hdt: fixing BACKSPACE behaviorErwan Velu2009-05-031-7/+3
|/ | | | | | | Impact: Fixing CLI behavior Prior to that commit, the BACKSPACE didn't worked properly. In some cases, the cursor was misplaced and was confusing user.
* hdt: Fix bug in module lookup (CLI)Pierre-Alexandre Meyer2009-04-261-4/+2
| | | | | | | | | | Compare the exact length. The previous version allowed `show diskkkkkk' to match `show disk'. Using strcmp is safe here, both strings are null-terminated by construction. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* hdt: Fix modules lookup to compare against full callback name (CLI)Pierre-Alexandre Meyer2009-04-261-1/+1
| | | | | | | | | | | | | Impact: remove auto-aliases feature but fix potential bug Comparing the first letters of the supplied command to look for the callback was interesting, since it added aliases automatically (`show bi' matched `show bios'). Unfortunately, that caused some issues in certain situation (`show disk' matching `show disks'). Removing the feature. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>