Changeset 7a1324aa50711b4d7f5d81f7e901081a150cf9fe for src/noit_console.c
- Timestamp:
- 02/12/08 03:35:01 (5 years ago)
- git-parent:
- Files:
-
- src/noit_console.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
src/noit_console.c
ra9f9cf2 r7a1324a 231 231 noit_console_closure_t ncct) { 232 232 char **cmds; 233 HistEvent ev; 233 234 int i, cnt = 32; 235 234 236 cmds = alloca(32 * sizeof(*cmds)); 235 237 i = noit_tokenize(buffer, cmds, &cnt); 238 239 /* < 0 is an error, that's fine. We want it in the history to "fix" */ 240 /* > 0 means we had arguments, so let's put it in the history */ 241 /* 0 means nothing -- and that isn't worthy of history inclusion */ 242 if(i) history(ncct->hist, &ev, H_ENTER, buffer); 243 236 244 if(i>cnt) nc_printf(ncct, "Command length too long.\n"); 237 245 else if(i<0) nc_printf(ncct, "Error at offset: %d\n", 0-i); … … 322 330 if(buffer) { 323 331 char *cmd_buffer; 324 HistEvent ev;325 332 cmd_buffer = malloc(plen+1); 326 333 memcpy(cmd_buffer, buffer, plen); … … 329 336 if(cmd_buffer[plen-1] == '\n') cmd_buffer[plen-1] = '\0'; 330 337 noitL(noit_debug, "IN: '%s'\n", cmd_buffer); 331 history(ncct->hist, &ev, H_ENTER, cmd_buffer);332 338 noit_console_dispatch(e, cmd_buffer, ncct); 333 339 free(cmd_buffer);
