aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--builtin.cpp3
-rw-r--r--complete.cpp3
-rw-r--r--complete.h4
-rw-r--r--expand.cpp9
-rw-r--r--parser.cpp9
-rw-r--r--reader.cpp4
-rw-r--r--wildcard.cpp6
7 files changed, 26 insertions, 12 deletions
diff --git a/builtin.cpp b/builtin.cpp
index 04dafb88..be6b06bd 100644
--- a/builtin.cpp
+++ b/builtin.cpp
@@ -3895,7 +3895,8 @@ void builtin_get_names( array_list_t *list )
void builtin_get_names2(std::vector<completion_t> &list) {
for (int i=0;i<builtin.size; ++i) {
- completion_t data_to_push = { (wchar_t*)builtin.arr[i].key };
+ completion_t data_to_push;
+ data_to_push.completion = (wchar_t*) builtin.arr[i].key;
list.push_back( data_to_push );
}
}
diff --git a/complete.cpp b/complete.cpp
index 0784da78..63bf6d64 100644
--- a/complete.cpp
+++ b/complete.cpp
@@ -1173,7 +1173,8 @@ static void complete_cmd( const wchar_t *cmd,
//function_get_names( &possible_comp, cmd[0] == L'_' );
wcstring_list_t names = function_get_names(cmd[0] == L'_' );
for (size_t i=0; i < names.size(); i++) {
- completion_t data_to_push = { names.at(i) };
+ completion_t data_to_push;
+ data_to_push.completion = names.at(i);
possible_comp.push_back( data_to_push );
}
diff --git a/complete.h b/complete.h
index 3c85253f..1cfeac28 100644
--- a/complete.h
+++ b/complete.h
@@ -127,6 +127,10 @@ struct completion_t
*/
int flags;
+ completion_t () {
+ flags = 0;
+ }
+
bool operator < (const completion_t& rhs) const { return this->completion < rhs.completion; }
bool operator == (const completion_t& rhs) const { return this->completion == rhs.completion; }
bool operator != (const completion_t& rhs) const { return this->completion != rhs.completion; }
diff --git a/expand.cpp b/expand.cpp
index feb49cde..90dffae1 100644
--- a/expand.cpp
+++ b/expand.cpp
@@ -1380,7 +1380,8 @@ static int expand_variables2( wchar_t * in, std::vector<completion_t> &out, int
wchar_t *next = (wchar_t *)al_get( &var_item_list, j );
if( is_ok && (i == 0) && (!in[stop_pos]) )
{
- completion_t data_to_push = { next };
+ completion_t data_to_push;
+ data_to_push.completion = next;
out.push_back( data_to_push );
}
else
@@ -1464,7 +1465,8 @@ static int expand_variables2( wchar_t * in, std::vector<completion_t> &out, int
if( !empty )
{
- completion_t data_to_push = { in };
+ completion_t data_to_push;
+ data_to_push.completion = in;
out.push_back( data_to_push );
}
else
@@ -1566,7 +1568,8 @@ static int expand_brackets( wchar_t *in, int flags, std::vector<completion_t> &o
if( bracket_begin == 0 )
{
- completion_t data_to_push = { in };
+ completion_t data_to_push;
+ data_to_push.completion = in;
out.push_back( data_to_push );
return 1;
}
diff --git a/parser.cpp b/parser.cpp
index 89a32e02..dfcdc17b 100644
--- a/parser.cpp
+++ b/parser.cpp
@@ -1944,7 +1944,8 @@ static int parse_job( process_t *p,
}
}
}
- completion_t data_to_push = { nxt };
+ completion_t data_to_push;
+ data_to_push.completion = nxt;
args->push_back( data_to_push );
}
@@ -1998,9 +1999,11 @@ static int parse_job( process_t *p,
// al_truncate( args, 0 );
args->clear();
// al_push( args, halloc_wcsdup( j, L"cd" ) );
- completion_t comp = { L"cd" };
+ completion_t comp;
+ comp.completion = L"cd";
args->push_back(comp);
- completion_t comp2 = { tmp };
+ completion_t comp2;
+ comp2.completion = tmp;
args->push_back( comp2 );
// free(tmp);
diff --git a/reader.cpp b/reader.cpp
index 552dd7fe..8b0ad503 100644
--- a/reader.cpp
+++ b/reader.cpp
@@ -1254,8 +1254,8 @@ static void run_pager( wchar_t *prefix, int is_quoted, const std::vector<complet
foo );
}
- free( foo );
- free( baz );
+// free( foo );
+// free( baz );
}
free( escaped_separator );
diff --git a/wildcard.cpp b/wildcard.cpp
index a23294a2..3435037b 100644
--- a/wildcard.cpp
+++ b/wildcard.cpp
@@ -897,7 +897,8 @@ static int wildcard_expand_internal( const wchar_t *wc,
else
{
res = 1;
- completion_t data_to_push = { base_dir };
+ completion_t data_to_push;
+ data_to_push.completion = base_dir;
if ( std::find( out.begin(), out.end(), data_to_push ) != out.end() ){
out.push_back( data_to_push);
}
@@ -970,7 +971,8 @@ static int wildcard_expand_internal( const wchar_t *wc,
}
else
{
- completion_t data_to_push = { long_name };
+ completion_t data_to_push;
+ data_to_push.completion = long_name;
out.push_back( data_to_push );
}
res = 1;