]> git.pld-linux.org Git - packages/vim.git/blame - 6.2.006
- use _desktopdir macro
[packages/vim.git] / 6.2.006
CommitLineData
b4704371
AF
1To: vim-dev@vim.org
2Subject: Patch 6.2.006
3Fcc: outbox
4From: Bram Moolenaar <Bram@moolenaar.net>
5Mime-Version: 1.0
6Content-Type: text/plain; charset=ISO-8859-1
7Content-Transfer-Encoding: 8bit
8------------
9
10Patch 6.2.006
11Problem: The Netbeans code contains an obsolete function that uses "vim61"
12 and sets the fall-back value for $VIMRUNTIME.
13Solution: Delete the obsolete function.
14Files: 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- /*
41- * Check symlinks for infinite recursion.
42- * "level" is for recursion control.
43- */
44- static void
45- resolve_symlinks(char *filename, int level)
46- {
47- struct stat sbuf;
48-
49- if ((level > 0) && (lstat(filename, &sbuf) == 0) && (S_ISLNK(sbuf.st_mode)))
50- {
51- char buf[MAXPATHLEN+1];
52- int len = readlink(filename, buf, MAXPATHLEN);
53-
54- if (len < 0 || len == MAXPATHLEN)
55- {
56- EMSGN("E652: readlink() failed, errno = %ld\n", errno);
57- }
58- else
59- {
60- buf[len] = '\0';
61-
62- if (buf[0] == '/')
63- {
64- /* link value is absolute */
65- strcpy(filename, buf);
66- }
67- else
68- {
69- /* link is relative */
70- char *p = strrchr(filename, '/');
71-
72- if (p == 0)
73- EMSG("E653: missing slash!?!");
74- else
75- if ((p - filename) + strlen(buf) > MAXPATHLEN)
76- EMSG("E654: buffer overflow in resolve_symlinks()");
77- else
78- strcpy(p+1, buf);
79- }
80-
81- /* check for symlinks in resulting path */
82- resolve_symlinks(filename, level-1);
83- }
84- }
85- }
86-
87- #endif /* HAVE_READLINK */
88-
89- static char *rundir = "";
90-
91- /*
92- * Set rundir -- Dynamically find VIMRUNTIME dir
93- */
94- void
95- netbeans_setRunDir(char *argv0)
96- {
97- char fullpath[MAXPATHLEN];
98- char *p;
99- static char buf[MAXPATHLEN];
100-
101- if (*argv0 == '/')
102- strcpy(fullpath, argv0);
103- else if (strchr(argv0, '/'))
104- {
105- getcwd(fullpath, MAXPATHLEN);
106- strcat(fullpath, "/");
107- strcat(fullpath, argv0);
108- }
109- else /* no slash, have to search path */
110- {
111- char *path = getenv("PATH");
112- if (path)
113- {
114- char *pathbuf = (char *)vim_strsave((char_u *)path);
115- path = strtok(pathbuf, ":");
116- do
117- {
118- strcpy(fullpath, path);
119- strcat(fullpath, "/");
120- strcat(fullpath, argv0);
121- if (access(fullpath, X_OK) == 0)
122- break;
123- else
124- fullpath[0] = NUL;
125- } while ((path=strtok(NULL, ":")) != NULL);
126- vim_free(pathbuf);
127- }
128- }
129-
130- #ifdef HAVE_READLINK
131- /* resolve symlinks to get "real" base dir */
132- resolve_symlinks(fullpath, 1000);
133- #endif /* HAVE_READLINK */
134-
135- /* search backwards for "bin" or "src" dir in fullpath */
136-
137- if (fullpath[0] != NUL)
138- {
139- p = strrchr(fullpath, '/');
140- while (p)
141- {
142- if (strncmp(p, "/bin", 4) == 0 || strncmp(p, "/src", 4) == 0)
143- {
144- /* vim is in /.../bin or /.../src */
145- rundir = (char *)vim_strsave((char_u *)fullpath);
146- break;
147- }
148- *p = NUL;
149- p = strrchr(fullpath, '/');
150- }
151- }
152-
153- /* now find "doc" dir from the rundir (if $VIMRUNTIME is not set) */
154-
155- if ((p = getenv("VIMRUNTIME")) != NULL && *p != NUL)
156- return;
157-
158- strcpy(buf, rundir);
159- strcat(buf, "/../share/vim/");
160- strcat(buf, "vim61/doc");
161- if (access(buf, R_OK) < 0)
162- {
163- strcpy(buf, rundir);
164- strcat(buf, "/../runtime/doc");
165- if (access(buf, R_OK) < 0)
166- {
167- /* not found! */
168- return;
169- }
170- else
171- {
172- strcpy(buf, rundir);
173- strcat(buf, "/../runtime");
174- }
175- }
176- else
177- {
178- strcpy(buf, rundir);
179- strcat(buf, "/../share/vim/vim61");
180- }
181- default_vimruntime_dir = (char_u *)buf;
182- }
183
184 /*
185 * Initialize highlights and signs for use by netbeans (mostly obsolete)
186--- 1943,1948 ----
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
189***************
190*** 2,8 ****
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));
198--- 2,7 ----
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
201***************
202*** 632,633 ****
203--- 632,635 ----
204 { /* Add new patch number below this line */
205+ /**/
206+ 6,
207 /**/
208
209--
210hundred-and-one symptoms of being an internet addict:
21160. As your car crashes through the guardrail on a mountain road, your first
212 instinct is to search for the "back" button.
213
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 ///
This page took 0.109822 seconds and 4 git commands to generate.