Merge pull request #257 from snehm/master

Fixing pointer initialisation to ensure correct tests especially on binaries compiled w/ optimizations.
This commit is contained in:
Martin Dvorak 2018-03-16 15:48:22 +01:00 committed by GitHub
commit 2ae5f1a7a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -643,9 +643,9 @@ unsigned hstr_make_selection(char *prefix, HistoryItems *history, int maxSelecti
bool regexpCompilationError=false; bool regexpCompilationError=false;
bool keywordsAllMatch; bool keywordsAllMatch;
char *keywordsSavePtr=NULL; char *keywordsSavePtr=NULL;
char *keywordsToken; char *keywordsToken=NULL;
char *keywordsParsedLine; char *keywordsParsedLine=NULL;
char *keywordsPointerToDelete; char *keywordsPointerToDelete=NULL;
for(i=0; i<count && selectionCount<maxSelectionCount; i++) { for(i=0; i<count && selectionCount<maxSelectionCount; i++) {
if(source[i]) { if(source[i]) {
if(!prefix || !strlen(prefix)) { if(!prefix || !strlen(prefix)) {
@ -759,12 +759,12 @@ void print_selection_row(char *text, int y, int width, char *pattern)
if(hstr->theme & HH_THEME_COLOR) { if(hstr->theme & HH_THEME_COLOR) {
color_attr_on(COLOR_PAIR(HH_COLOR_MATCH)); color_attr_on(COLOR_PAIR(HH_COLOR_MATCH));
} }
char* p; char* p=NULL;
char* pp; char* pp=NULL;
char* keywordsSavePtr; char* keywordsSavePtr=NULL;
char* keywordsToken; char* keywordsToken=NULL;
char* keywordsParsedLine; char* keywordsParsedLine=NULL;
char* keywordsPointerToDelete; char* keywordsPointerToDelete=NULL;
switch(hstr->historyMatch) { switch(hstr->historyMatch) {
case HH_MATCH_SUBSTRING: case HH_MATCH_SUBSTRING: