Changeset 5a9f6fe for history.c


Ignore:
Timestamp:
Nov 5, 2003, 10:48:32 AM (20 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
cb78880
Parents:
3c7d007a
Message:
Command history now doesn't allow the most recent entry to be repeated
If format_msg returns "" print "<unformatted message>"
File:
1 edited

Legend:

Unmodified
Added
Removed
  • history.c

    r3c7d007a r5a9f6fe  
    5353  size=owl_list_get_size(&(h->hist));
    5454
    55   /* if repeats are disallowed, check if the line is present already */
    56   if (!h->repeats) {
    57     for (i=0; i<size; i++) {
    58       if (!strcmp(line, owl_list_get_element(&(h->hist), i))) return;
    59     }
    60   }
    61 
    6255  /* if partial is set, remove the first entry first */
    6356  if (h->partial) {
    6457    owl_list_remove_element(&(h->hist), 0);
     58  }
     59
     60  /* if repeats are disallowed, check if the line is the same as the last */
     61  if (owl_list_get_size(&(h->hist))>0) {
     62    if (!strcmp(line, owl_list_get_element(&(h->hist), 0))) return;
    6563  }
    6664
Note: See TracChangeset for help on using the changeset viewer.