- Timestamp:
- Oct 28, 2003, 7:56:35 PM (20 years ago)
- 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:
- cee1f25
- Parents:
- faf71b5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
history.c
r70b53ec r12c35df 9 9 h->touched=0; /* whether we've gone into history */ 10 10 h->partial=0; /* is the 0th element is partially composed? */ 11 h->repeats=1; /* by default we'll allow repeat entries */ 12 } 13 14 void owl_history_set_norepeats(owl_history *h) 15 { 16 h->repeats=0; 11 17 } 12 18 … … 42 48 void owl_history_store(owl_history *h, char *line) 43 49 { 44 int size;50 int i, size; 45 51 46 52 if (!h) return; 53 size=owl_list_get_size(&(h->hist)); 54 55 /* if repeats are disallowed, check if the line is present already */ 56 for (i=0; i<size; i++) { 57 if (!strcmp(line, owl_list_get_element(&(h->hist), i))) return; 58 } 47 59 48 60 /* if partial is set, remove the first entry first */ … … 52 64 53 65 /* if we've reached the max history size, pop off the last element */ 54 size=owl_list_get_size(&(h->hist));55 66 if (size>OWL_HISTORYSIZE) { 56 67 owl_free(owl_list_get_element(&(h->hist), size-1));
Note: See TracChangeset
for help on using the changeset viewer.