search for: argst

Displaying 2 results from an estimated 2 matches for "argst".

Did you mean: args
2009 Mar 13
1
[PATCH 1/1] cmd.c32: allow an option for clearing the screen
...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++) + printf("\n"); + } - for (i = 1; i < argc; i++) + for (i = argst; i < argc; i++) len += strlen(argv[i]) + 1; tmp = cmd = alloca(l...
2009 Feb 22
2
NEW: COM32 module to run another command, optionally clearing the screen
..._AUTHOR "Gene Cumm" #define APP_VER "beta-b005" int main(int argc, char *argv[]) { char cmdstr[RUN_CMD_SZ]; /* Command string to execute */ int curpos; /* Current position in cmdstr; Use memcpy rather than strcat */ int arglen; /* length of current argument string */ int argst; /* Starting argument to listen to */ int i; /* Initialization */ curpos = 0; argst = 1; cmdstr[0] = 0; console_ansi_std(); DEBUG_PRINTF("\nMax Command line:%d\n", RUN_CMD_SZ); DEBUG_PRINTF("argc:%d\n\n", argc); if (strcmp(argv[1], "-c") == 0) { DEBUG_PRIN...