home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 6.2.006 < prev    next >
Encoding:
Internet Message Format  |  2003-10-13  |  5.5 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.2.006
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 6.2.006
  11. Problem:    The Netbeans code contains an obsolete function that uses "vim61"
  12.         and sets the fall-back value for $VIMRUNTIME.
  13. Solution:   Delete the obsolete function.
  14. Files:        src/main.c, src/netbeans.c, src/proto/netbeans.pro
  15.  
  16.  
  17. *** ../vim-6.2.005/src/main.c    Thu May 29 11:20:15 2003
  18. --- src/main.c    Mon Jun  2 22:10:01 2003
  19. ***************
  20. *** 316,324 ****
  21.   #ifdef FEAT_SUN_WORKSHOP
  22.       findYourself(argv[0]);
  23.   #endif
  24. - #ifdef FEAT_NETBEANS_INTG
  25. -     netbeans_setRunDir(argv[0]);
  26. - #endif
  27.   #if defined(FEAT_GUI) && !defined(MAC_OS_CLASSIC)
  28.       gui_prepare(&argc, argv);    /* Prepare for possibly starting GUI sometime */
  29.       TIME_MSG("GUI prepared");
  30. --- 316,321 ----
  31. *** ../vim-6.2.005/src/netbeans.c    Sun Jun  1 16:03:39 2003
  32. --- src/netbeans.c    Mon Jun  2 22:12:16 2003
  33. ***************
  34. *** 1943,2093 ****
  35.       gui_mch_flush();
  36.   }
  37.   
  38. - #ifdef HAVE_READLINK
  39. - /*
  40. -  * Check symlinks for infinite recursion.
  41. -  * "level" is for recursion control.
  42. -  */
  43. -     static void
  44. - resolve_symlinks(char *filename, int level)
  45. - {
  46. -     struct stat sbuf;
  47. -     if ((level > 0) && (lstat(filename, &sbuf) == 0) && (S_ISLNK(sbuf.st_mode)))
  48. -     {
  49. -     char buf[MAXPATHLEN+1];
  50. -     int len = readlink(filename, buf, MAXPATHLEN);
  51. -     if (len < 0 || len == MAXPATHLEN)
  52. -     {
  53. -         EMSGN("E652: readlink() failed, errno = %ld\n", errno);
  54. -     }
  55. -     else
  56. -     {
  57. -         buf[len] = '\0';
  58. -         if (buf[0] == '/')
  59. -         {
  60. -         /* link value is absolute */
  61. -         strcpy(filename, buf);
  62. -         }
  63. -         else
  64. -         {
  65. -         /* link is relative */
  66. -         char *p = strrchr(filename, '/');
  67. -         if (p == 0)
  68. -             EMSG("E653: missing slash!?!");
  69. -         else
  70. -             if ((p - filename) + strlen(buf) > MAXPATHLEN)
  71. -             EMSG("E654: buffer overflow in resolve_symlinks()");
  72. -             else
  73. -             strcpy(p+1, buf);
  74. -         }
  75. -         /* check for symlinks in resulting path */
  76. -         resolve_symlinks(filename, level-1);
  77. -     }
  78. -     }
  79. - }
  80. - #endif /* HAVE_READLINK */
  81. - static char *rundir = "";
  82. - /*
  83. -  * Set rundir -- Dynamically find VIMRUNTIME dir
  84. -  */
  85. -     void
  86. - netbeans_setRunDir(char *argv0)
  87. - {
  88. -     char    fullpath[MAXPATHLEN];
  89. -     char    *p;
  90. -     static char buf[MAXPATHLEN];
  91. -     if (*argv0 == '/')
  92. -     strcpy(fullpath, argv0);
  93. -     else if (strchr(argv0, '/'))
  94. -     {
  95. -     getcwd(fullpath, MAXPATHLEN);
  96. -     strcat(fullpath, "/");
  97. -     strcat(fullpath, argv0);
  98. -     }
  99. -     else /* no slash, have to search path */
  100. -     {
  101. -     char *path = getenv("PATH");
  102. -     if (path)
  103. -     {
  104. -         char *pathbuf = (char *)vim_strsave((char_u *)path);
  105. -         path = strtok(pathbuf, ":");
  106. -         do
  107. -         {
  108. -         strcpy(fullpath, path);
  109. -         strcat(fullpath, "/");
  110. -         strcat(fullpath, argv0);
  111. -         if (access(fullpath, X_OK) == 0)
  112. -             break;
  113. -         else
  114. -             fullpath[0] = NUL;
  115. -         } while ((path=strtok(NULL, ":")) != NULL);
  116. -         vim_free(pathbuf);
  117. -     }
  118. -     }
  119. - #ifdef HAVE_READLINK
  120. -     /* resolve symlinks to get "real" base dir */
  121. -     resolve_symlinks(fullpath, 1000);
  122. - #endif /* HAVE_READLINK */
  123. -     /* search backwards for "bin" or "src" dir in fullpath */
  124. -     if (fullpath[0] != NUL)
  125. -     {
  126. -     p = strrchr(fullpath, '/');
  127. -     while (p)
  128. -     {
  129. -         if (strncmp(p, "/bin", 4) == 0 || strncmp(p, "/src", 4) == 0)
  130. -         {
  131. -         /* vim is in /.../bin  or /.../src */
  132. -         rundir = (char *)vim_strsave((char_u *)fullpath);
  133. -         break;
  134. -         }
  135. -         *p = NUL;
  136. -         p = strrchr(fullpath, '/');
  137. -     }
  138. -     }
  139. -     /* now find "doc" dir from the rundir (if $VIMRUNTIME is not set) */
  140. -     if ((p = getenv("VIMRUNTIME")) != NULL && *p != NUL)
  141. -     return;
  142. -     strcpy(buf, rundir);
  143. -     strcat(buf, "/../share/vim/");
  144. -     strcat(buf, "vim61/doc");
  145. -     if (access(buf, R_OK) < 0)
  146. -     {
  147. -     strcpy(buf, rundir);
  148. -     strcat(buf, "/../runtime/doc");
  149. -     if (access(buf, R_OK) < 0)
  150. -     {
  151. -         /* not found! */
  152. -         return;
  153. -     }
  154. -     else
  155. -     {
  156. -         strcpy(buf, rundir);
  157. -         strcat(buf, "/../runtime");
  158. -     }
  159. -     }
  160. -     else
  161. -     {
  162. -     strcpy(buf, rundir);
  163. -     strcat(buf, "/../share/vim/vim61");
  164. -     }
  165. -     default_vimruntime_dir = (char_u *)buf;
  166. - }
  167.   
  168.   /*
  169.    * Initialize highlights and signs for use by netbeans  (mostly obsolete)
  170. --- 1943,1948 ----
  171. *** ../vim-6.2.005/src/proto/netbeans.pro    Sun Jun  1 12:26:24 2003
  172. --- src/proto/netbeans.pro    Mon Jun  2 22:11:13 2003
  173. ***************
  174. *** 2,8 ****
  175.   void netbeans_Xt_connect __ARGS((void *context));
  176.   void netbeans_gtk_connect __ARGS((void));
  177.   void netbeans_end __ARGS((void));
  178. - void netbeans_setRunDir __ARGS((char *argv0));
  179.   void netbeans_startup_done __ARGS((void));
  180.   void netbeans_frame_moved __ARGS((int new_x, int new_y));
  181.   void netbeans_file_opened __ARGS((char *filename));
  182. --- 2,7 ----
  183. *** ../vim-6.2.005/src/version.c    Mon Jun  2 22:22:50 2003
  184. --- src/version.c    Mon Jun  2 22:25:28 2003
  185. ***************
  186. *** 632,633 ****
  187. --- 632,635 ----
  188.   {   /* Add new patch number below this line */
  189. + /**/
  190. +     6,
  191.   /**/
  192.  
  193. -- 
  194. hundred-and-one symptoms of being an internet addict:
  195. 60. As your car crashes through the guardrail on a mountain road, your first
  196.     instinct is to search for the "back" button.
  197.  
  198.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  199. ///          Creator of Vim - Vi IMproved -- http://www.Vim.org          \\\
  200. \\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
  201.  \\\     Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///
  202.