busybox-1.8.2-vi.patch 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. diff -urN busybox-1.8.2/editors/vi.c busybox-1.8.2-vi/editors/vi.c
  2. --- busybox-1.8.2/editors/vi.c 2007-11-10 01:40:54.000000000 +0000
  3. +++ busybox-1.8.2-vi/editors/vi.c 2007-12-10 16:26:01.000000000 +0000
  4. @@ -184,6 +184,7 @@
  5. #if ENABLE_FEATURE_VI_COLON
  6. char *initial_cmds[3]; // currently 2 entries, NULL terminated
  7. #endif
  8. + char readbuffer[MAX_LINELEN];
  9. };
  10. #define G (*ptr_to_globals)
  11. #define text (G.text )
  12. @@ -200,6 +201,10 @@
  13. #define term_orig (G.term_orig )
  14. #define term_vi (G.term_vi )
  15. #define initial_cmds (G.initial_cmds )
  16. +#define readbuffer (G.readbuffer )
  17. +#define INIT_G() do { \
  18. + PTR_TO_GLOBALS = xzalloc(sizeof(G)); \
  19. +} while (0)
  20. static int init_text_buffer(char *); // init from file or create new
  21. static void edit_file(char *); // edit one file
  22. @@ -321,7 +326,7 @@
  23. my_pid = getpid();
  24. #endif
  25. - PTR_TO_GLOBALS = xzalloc(sizeof(G));
  26. + INIT_G();
  27. #if ENABLE_FEATURE_VI_CRASHME
  28. srand((long) my_pid);
  29. @@ -2142,8 +2147,6 @@
  30. return safe_poll(pfd, 1, hund*10) > 0;
  31. }
  32. -#define readbuffer bb_common_bufsiz1
  33. -
  34. static int readed_for_parse;
  35. //----- IO Routines --------------------------------------------