File src/hstr.c changed (mode: 100644) (index 87e782a..dfe29fb) |
... |
... |
char *hstr_print_selection(unsigned maxHistoryItems, char *pattern, Hstr *hstr) |
715 |
715 |
move(Y_OFFSET_ITEMS, 0); |
move(Y_OFFSET_ITEMS, 0); |
716 |
716 |
clrtobot(); |
clrtobot(); |
717 |
717 |
|
|
718 |
|
int start, end; |
|
|
718 |
|
int start, count; |
719 |
719 |
char screenLine[CMDLINE_LNG]; |
char screenLine[CMDLINE_LNG]; |
720 |
720 |
for (i = 0; i<height; ++i) { |
for (i = 0; i<height; ++i) { |
721 |
721 |
if(i<hstr->selectionSize) { |
if(i<hstr->selectionSize) { |
|
... |
... |
char *hstr_print_selection(unsigned maxHistoryItems, char *pattern, Hstr *hstr) |
723 |
723 |
if(pattern && strlen(pattern)) { |
if(pattern && strlen(pattern)) { |
724 |
724 |
if(hstr->historyMatch==HH_MATCH_REGEXP) { |
if(hstr->historyMatch==HH_MATCH_REGEXP) { |
725 |
725 |
start=hstr->selectionRegexpMatch[i].rm_so; |
start=hstr->selectionRegexpMatch[i].rm_so; |
726 |
|
end=hstr->selectionRegexpMatch[i].rm_eo-start; |
|
|
726 |
|
count=hstr->selectionRegexpMatch[i].rm_eo-start; |
|
727 |
|
if(count>CMDLINE_LNG) { |
|
728 |
|
count=CMDLINE_LNG-1; |
|
729 |
|
} |
727 |
730 |
strncpy(screenLine, |
strncpy(screenLine, |
728 |
731 |
hstr->selection[i]+start, |
hstr->selection[i]+start, |
729 |
|
end); |
|
730 |
|
screenLine[end]=0; |
|
|
732 |
|
count); |
|
733 |
|
screenLine[count]=0; |
731 |
734 |
} else { |
} else { |
732 |
735 |
strcpy(screenLine, pattern); |
strcpy(screenLine, pattern); |
733 |
736 |
} |
} |