X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=selector.cc;h=617edf0f1ef698cf7963d7efe8a69a3f0a89a39b;hb=42294c6ab7b85294b8f2931291c1dcc977642806;hp=0062a3b35caf0aaec20e2e9c9df07f8fde32ac9b;hpb=d21dcab62f2e81f22c0c7c721fdffbcf244ac349;p=selector.git diff --git a/selector.cc b/selector.cc index 0062a3b..617edf0 100644 --- a/selector.cc +++ b/selector.cc @@ -48,7 +48,7 @@ const int buffer_size = 1024; // Yeah, global variables! -int nb_lines_max = 10000; +int nb_lines_max = 1000; char pattern_separator = ';'; int output_to_vt_buffer = 0; int with_colors = 1; @@ -322,7 +322,6 @@ void update_screen(int *current_line, int *temporary_line, int motion, int main(int argc, char **argv) { char buffer[buffer_size]; - char *lines[nb_lines_max]; int color_fg_modeline, color_bg_modeline; int color_fg_highlight, color_bg_highlight; @@ -424,6 +423,8 @@ int main(int argc, char **argv) { } } + char **lines = new char *[nb_lines_max]; + if(!input_filename[0]) { cerr << "You must specify a input file with -f." << endl; exit(1); @@ -581,6 +582,7 @@ int main(int argc, char **argv) { for(int l = 0; l < nb_lines; l++) { delete[] lines[l]; } + delete[] lines; exit(0); }