xaizek / vifm (License: GPLv2+) (since 2018-12-07)
Vifm is a file manager with curses interface, which provides Vi[m]-like environment for managing objects within file systems, extended with some useful ideas from mutt.
Commit 8e1049edb14a64e7764209bb1e4d9fa5b234e903

Fix crash on a sequence of :let/:unlet statements
Thanks to filterfalse.
Author: xaizek
Author date (UTC): 2014-04-23 20:31
Committer name: xaizek
Committer date (UTC): 2014-04-23 20:31
Parent(s): f616e614ba545d5fc0872b2c2f9cb094df130371
Signing key:
Tree: 801094733813344b9904f9e5af8f47f95c8835bc
File Lines added Lines deleted
ChangeLog 3 0
src/engine/variables.c 1 1
tests/variables/test.c 4 1
tests/variables/unlet.c 38 0
File ChangeLog changed (mode: 100644) (index 0aa8ed860..f45d277c1)
178 178 Fixed testing whether application uses GUI on Windows when path contains Fixed testing whether application uses GUI on Windows when path contains
179 179 spaces. spaces.
180 180
181 Fixed crash on a sequence of :let/:unlet statements. Thanks to
182 filterfalse.
183
181 184 0.7.6-beta2 to 0.7.6 0.7.6-beta2 to 0.7.6
182 185
183 186 Removed check for stdscr from the configure. Thanks to jtbm37. Removed check for stdscr from the configure. Thanks to jtbm37.
File src/engine/variables.c changed (mode: 100644) (index f7778ad7e..e89dcebe1)
... ... get_record(const char *name)
328 328 return NULL; return NULL;
329 329 vars = p; vars = p;
330 330 p = &vars[nvars]; p = &vars[nvars];
331 nvars++;
331 332 } }
332 333
333 334 /* initialize new record */ /* initialize new record */
 
... ... get_record(const char *name)
341 342 free_record(p); free_record(p);
342 343 return NULL; return NULL;
343 344 } }
344 nvars++;
345 345 return p; return p;
346 346 } }
347 347
File tests/variables/test.c changed (mode: 100644) (index c0e78658d..470989d67)
... ... void format_tests(void);
11 11 void clear_tests(void); void clear_tests(void);
12 12 void envvars_tests(void); void envvars_tests(void);
13 13 void completion_tests(void); void completion_tests(void);
14 void unlet_tests(void);
14 15
15 16 void void
16 17 all_tests(void) all_tests(void)
 
... ... all_tests(void)
19 20 clear_tests(); clear_tests();
20 21 envvars_tests(); envvars_tests();
21 22 completion_tests(); completion_tests();
23 unlet_tests();
22 24 } }
23 25
24 26 static void static void
 
... ... main(int argc, char **argv)
47 49 return run_tests(all_tests) == 0; return run_tests(all_tests) == 0;
48 50 } }
49 51
50 /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab : */
52 /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */
53 /* vim: set cinoptions+=t0 : */
File tests/variables/unlet.c added (mode: 100644) (index 000000000..398c13356)
1 #include "seatest.h"
2
3 #include "../../src/engine/variables.h"
4 #include "../../src/utils/env.h"
5
6 #define VAR_NAME_BASE "VAR"
7
8 static void
9 setup(void)
10 {
11 env_remove(VAR_NAME_BASE "1");
12 env_remove(VAR_NAME_BASE "2");
13 env_remove(VAR_NAME_BASE "3");
14 }
15
16 static void
17 test_envvar_table_updates_do_not_crash(void)
18 {
19 assert_int_equal(0, let_variable("$" VAR_NAME_BASE "1='VAL'"));
20 assert_int_equal(0, unlet_variables("$" VAR_NAME_BASE "1"));
21 assert_int_equal(0, let_variable("$" VAR_NAME_BASE "2='VAL'"));
22 assert_int_equal(0, let_variable("$" VAR_NAME_BASE "3='VAL'"));
23 }
24
25 void
26 unlet_tests(void)
27 {
28 test_fixture_start();
29
30 fixture_setup(setup);
31
32 run_test(test_envvar_table_updates_do_not_crash);
33
34 test_fixture_end();
35 }
36
37 /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */
38 /* vim: set cinoptions+=t0 : */
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/vifm

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/vifm

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master