bash30-010 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. BASH PATCH REPORT
  2. =================
  3. Bash-Release: 3.0
  4. Patch-ID: bash30-010
  5. Bug-Reported-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
  6. Bug-Reference-ID: <E1Bo8Sq-0004u5-00@bouh>
  7. Bug-Reference-URL: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=261142
  8. Bug-Description:
  9. When trying to auto-complete ~/../``/, I just get:
  10. malloc: bashline.c:1340: assertion botched
  11. free: start and end chunk sizes differ
  12. last command: kill -9 %2
  13. Stopping myself...
  14. Patch:
  15. *** ../bash-3.0/bashline.c Mon Jul 5 23:22:12 2004
  16. --- bashline.c Thu Sep 2 16:00:12 2004
  17. ***************
  18. *** 101,104 ****
  19. --- 101,105 ----
  20. /* Helper functions for Readline. */
  21. + static int bash_directory_expansion __P((char **));
  22. static int bash_directory_completion_hook __P((char **));
  23. static int filename_completion_ignore __P((char **));
  24. ***************
  25. *** 293,297 ****
  26. at = strchr (rl_completer_word_break_characters, '@');
  27. if ((at == 0 && on_or_off == 0) || (at != 0 && on_or_off != 0))
  28. ! return;
  29. /* We have something to do. Do it. */
  30. --- 294,298 ----
  31. at = strchr (rl_completer_word_break_characters, '@');
  32. if ((at == 0 && on_or_off == 0) || (at != 0 && on_or_off != 0))
  33. ! return old_value;
  34. /* We have something to do. Do it. */
  35. ***************
  36. *** 1407,1414 ****
  37. if (*hint_text == '~')
  38. {
  39. ! int l, tl, vl;
  40. vl = strlen (val);
  41. tl = strlen (hint_text);
  42. l = vl - hint_len; /* # of chars added */
  43. temp = (char *)xmalloc (l + 2 + tl);
  44. strcpy (temp, hint_text);
  45. --- 1408,1424 ----
  46. if (*hint_text == '~')
  47. {
  48. ! int l, tl, vl, dl;
  49. ! char *rd;
  50. vl = strlen (val);
  51. tl = strlen (hint_text);
  52. + #if 0
  53. l = vl - hint_len; /* # of chars added */
  54. + #else
  55. + rd = savestring (filename_hint);
  56. + bash_directory_expansion (&rd);
  57. + dl = strlen (rd);
  58. + l = vl - dl; /* # of chars added */
  59. + free (rd);
  60. + #endif
  61. temp = (char *)xmalloc (l + 2 + tl);
  62. strcpy (temp, hint_text);
  63. ***************
  64. *** 2188,2191 ****
  65. --- 2198,2222 ----
  66. }
  67. + /* Simulate the expansions that will be performed by
  68. + rl_filename_completion_function. This must be called with the address of
  69. + a pointer to malloc'd memory. */
  70. + static int
  71. + bash_directory_expansion (dirname)
  72. + char **dirname;
  73. + {
  74. + char *d;
  75. +
  76. + d = savestring (*dirname);
  77. +
  78. + if (rl_directory_rewrite_hook)
  79. + (*rl_directory_rewrite_hook) (&d);
  80. +
  81. + if (rl_directory_completion_hook && (*rl_directory_completion_hook) (&d))
  82. + {
  83. + free (*dirname);
  84. + *dirname = d;
  85. + }
  86. + }
  87. +
  88. /* Handle symbolic link references and other directory name
  89. expansions while hacking completion. */
  90. *** ../bash-3.0/patchlevel.h Wed Aug 22 08:05:39 2001
  91. --- patchlevel.h Thu Sep 2 15:04:32 2004
  92. ***************
  93. *** 26,30 ****
  94. looks for to find the patch level (for the sccs version string). */
  95. ! #define PATCHLEVEL 9
  96. #endif /* _PATCHLEVEL_H_ */
  97. --- 26,30 ----
  98. looks for to find the patch level (for the sccs version string). */
  99. ! #define PATCHLEVEL 10
  100. #endif /* _PATCHLEVEL_H_ */