4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
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
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
21 #ifdef FEAT_SUN_WORKSHOP
22 findYourself(argv[0]);
24 - #ifdef FEAT_NETBEANS_INTG
25 - netbeans_setRunDir(argv[0]);
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");
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
38 - #ifdef HAVE_READLINK
41 - * Check symlinks for infinite recursion.
42 - * "level" is for recursion control.
45 - resolve_symlinks(char *filename, int level)
49 - if ((level > 0) && (lstat(filename, &sbuf) == 0) && (S_ISLNK(sbuf.st_mode)))
51 - char buf[MAXPATHLEN+1];
52 - int len = readlink(filename, buf, MAXPATHLEN);
54 - if (len < 0 || len == MAXPATHLEN)
56 - EMSGN("E652: readlink() failed, errno = %ld\n", errno);
64 - /* link value is absolute */
65 - strcpy(filename, buf);
69 - /* link is relative */
70 - char *p = strrchr(filename, '/');
73 - EMSG("E653: missing slash!?!");
75 - if ((p - filename) + strlen(buf) > MAXPATHLEN)
76 - EMSG("E654: buffer overflow in resolve_symlinks()");
81 - /* check for symlinks in resulting path */
82 - resolve_symlinks(filename, level-1);
87 - #endif /* HAVE_READLINK */
89 - static char *rundir = "";
92 - * Set rundir -- Dynamically find VIMRUNTIME dir
95 - netbeans_setRunDir(char *argv0)
97 - char fullpath[MAXPATHLEN];
99 - static char buf[MAXPATHLEN];
102 - strcpy(fullpath, argv0);
103 - else if (strchr(argv0, '/'))
105 - getcwd(fullpath, MAXPATHLEN);
106 - strcat(fullpath, "/");
107 - strcat(fullpath, argv0);
109 - else /* no slash, have to search path */
111 - char *path = getenv("PATH");
114 - char *pathbuf = (char *)vim_strsave((char_u *)path);
115 - path = strtok(pathbuf, ":");
118 - strcpy(fullpath, path);
119 - strcat(fullpath, "/");
120 - strcat(fullpath, argv0);
121 - if (access(fullpath, X_OK) == 0)
125 - } while ((path=strtok(NULL, ":")) != NULL);
130 - #ifdef HAVE_READLINK
131 - /* resolve symlinks to get "real" base dir */
132 - resolve_symlinks(fullpath, 1000);
133 - #endif /* HAVE_READLINK */
135 - /* search backwards for "bin" or "src" dir in fullpath */
137 - if (fullpath[0] != NUL)
139 - p = strrchr(fullpath, '/');
142 - if (strncmp(p, "/bin", 4) == 0 || strncmp(p, "/src", 4) == 0)
144 - /* vim is in /.../bin or /.../src */
145 - rundir = (char *)vim_strsave((char_u *)fullpath);
149 - p = strrchr(fullpath, '/');
153 - /* now find "doc" dir from the rundir (if $VIMRUNTIME is not set) */
155 - if ((p = getenv("VIMRUNTIME")) != NULL && *p != NUL)
158 - strcpy(buf, rundir);
159 - strcat(buf, "/../share/vim/");
160 - strcat(buf, "vim61/doc");
161 - if (access(buf, R_OK) < 0)
163 - strcpy(buf, rundir);
164 - strcat(buf, "/../runtime/doc");
165 - if (access(buf, R_OK) < 0)
172 - strcpy(buf, rundir);
173 - strcat(buf, "/../runtime");
178 - strcpy(buf, rundir);
179 - strcat(buf, "/../share/vim/vim61");
181 - default_vimruntime_dir = (char_u *)buf;
185 * Initialize highlights and signs for use by netbeans (mostly obsolete)
187 *** ../vim-6.2.005/src/proto/netbeans.pro Sun Jun 1 12:26:24 2003
188 --- src/proto/netbeans.pro Mon Jun 2 22:11:13 2003
191 void netbeans_Xt_connect __ARGS((void *context));
192 void netbeans_gtk_connect __ARGS((void));
193 void netbeans_end __ARGS((void));
194 - void netbeans_setRunDir __ARGS((char *argv0));
195 void netbeans_startup_done __ARGS((void));
196 void netbeans_frame_moved __ARGS((int new_x, int new_y));
197 void netbeans_file_opened __ARGS((char *filename));
199 *** ../vim-6.2.005/src/version.c Mon Jun 2 22:22:50 2003
200 --- src/version.c Mon Jun 2 22:25:28 2003
204 { /* Add new patch number below this line */
210 hundred-and-one symptoms of being an internet addict:
211 60. As your car crashes through the guardrail on a mountain road, your first
212 instinct is to search for the "back" button.
214 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
215 /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
216 \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
217 \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///