Show
Ignore:
Timestamp:
02/12/08 03:35:01 (7 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1202787301 +0000
git-parent:

[998fcf4e10bc37cda542d39850f8da317f74f79d]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1202787301 +0000
Message:

online editing of attributes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/noit_console.c

    ra9f9cf2 r7a1324a  
    231231                      noit_console_closure_t ncct) { 
    232232  char **cmds; 
     233  HistEvent ev; 
    233234  int i, cnt = 32; 
     235 
    234236  cmds = alloca(32 * sizeof(*cmds)); 
    235237  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 
    236244  if(i>cnt) nc_printf(ncct, "Command length too long.\n"); 
    237245  else if(i<0) nc_printf(ncct, "Error at offset: %d\n", 0-i); 
     
    322330    if(buffer) { 
    323331      char *cmd_buffer; 
    324       HistEvent ev; 
    325332      cmd_buffer = malloc(plen+1); 
    326333      memcpy(cmd_buffer, buffer, plen); 
     
    329336      if(cmd_buffer[plen-1] == '\n') cmd_buffer[plen-1] = '\0'; 
    330337      noitL(noit_debug, "IN: '%s'\n", cmd_buffer); 
    331       history(ncct->hist, &ev, H_ENTER, cmd_buffer); 
    332338      noit_console_dispatch(e, cmd_buffer, ncct); 
    333339      free(cmd_buffer);