Displaying 2 results from an estimated 2 matches for "num_nl".
2009 Feb 22
2
NEW: COM32 module to run another command, optionally clearing the screen
...ename to run.c from runc.c
* Allow a '-c' as the first option in order to clear the screen
* b006 Check to see if it's at the end of the argument list in the for before
* adding the space/null at the end of the string.
* b005 Rename from aliasclr.c to runc.c
* b004 aliasclr.c; Add NUM_NL newlines to beginning of output
* Cleanup code to standards
* b003 Work on resolving a potential overflow issue with building the
* command string to pass to syslinux_run_command()
* Reformatted {} in more visual style.
* Use MAX_CMDLINE_LEN or COMMAND_LINE_SIZE (in that order) if available...
2009 Mar 13
1
[PATCH 1/1] cmd.c32: allow an option for clearing the screen
...by dumping a series of newlines to the screen.
Applies against current head.
diff --git a/com32/modules/cmd.c b/com32/modules/cmd.c
index e1d646b..ff54128 100644
--- a/com32/modules/cmd.c
+++ b/com32/modules/cmd.c
@@ -20,19 +20,29 @@
#include <alloca.h>
#include <com32.h>
+#define NUM_NL 40
+ /* Number of lines to clear */
+
int main(int argc, const char *argv[])
{
size_t len = 0;
char *cmd;
char *tmp;
int i;
+ int argst = 1; /* Starting argument */
+
+ if (strcmp(argv[1], "-c") == 0) {
+ argst++;
+ for (i = 0; i < NUM_NL; i++)
+...