1 To: vim_dev@googlegroups.com
4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: Items on the stack may be too big.
12 Solution: Make items static or allocate them.
13 Files: src/eval.c, src/ex_cmds.c, src/ex_cmds2.c, src/ex_docmd.c,
14 src/fileio.c, src/hardcopy.c, src/quickfix.c, src/main.c,
15 src/netbeans.c, src/spell.c, src/tag.c, src/vim.h, src/xxd/xxd.c
18 *** ../vim-7.3.160/src/eval.c 2011-04-11 13:46:07.000000000 +0200
19 --- src/eval.c 2011-04-11 21:05:50.000000000 +0200
22 typval_T *argvars UNUSED;
25 ! char_u cwd[MAXPATHL];
27 rettv->v_type = VAR_STRING;
28 ! if (mch_dirname(cwd, MAXPATHL) == FAIL)
29 ! rettv->vval.v_string = NULL;
32 ! rettv->vval.v_string = vim_strsave(cwd);
33 #ifdef BACKSLASH_IN_FILENAME
34 ! if (rettv->vval.v_string != NULL)
35 ! slash_adjust(rettv->vval.v_string);
41 typval_T *argvars UNUSED;
46 rettv->v_type = VAR_STRING;
47 ! rettv->vval.v_string = NULL;
48 ! cwd = alloc(MAXPATHL);
51 ! if (mch_dirname(cwd, MAXPATHL) != FAIL)
53 ! rettv->vval.v_string = vim_strsave(cwd);
54 #ifdef BACKSLASH_IN_FILENAME
55 ! if (rettv->vval.v_string != NULL)
56 ! slash_adjust(rettv->vval.v_string);
69 + #ifdef HAVE_READLINK
73 p = get_tv_string(&argvars[0]);
80 - char_u buf[MAXPATHL + 1];
83 char_u *remain = NULL;
91 + buf = alloc(MAXPATHL + 1);
106 rettv->v_type = VAR_STRING;
110 typval_T *argvars UNUSED;
113 ! char_u fname[MAXPATHL + 1];
117 if (rettv_list_alloc(rettv) == FAIL)
120 for (first = TRUE; ; first = FALSE)
121 if (get_tagfname(&tn, first, fname) == FAIL
122 || list_append_string(rettv->vval.v_list, fname, -1) == FAIL)
129 typval_T *argvars UNUSED;
136 if (rettv_list_alloc(rettv) == FAIL)
138 + fname = alloc(MAXPATHL);
142 for (first = TRUE; ; first = FALSE)
143 if (get_tagfname(&tn, first, fname) == FAIL
144 || list_append_string(rettv->vval.v_list, fname, -1) == FAIL)
151 *** ../vim-7.3.160/src/ex_cmds.c 2011-02-01 13:48:47.000000000 +0100
152 --- src/ex_cmds.c 2011-04-11 20:51:34.000000000 +0200
155 #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
156 if (p_confirm || cmdmod.confirm)
158 ! char_u buff[IOSIZE];
160 dialog_msg(buff, _("Overwrite existing file \"%s\"?"), fname);
161 if (vim_dialog_yesno(VIM_QUESTION, NULL, buff, 2) != VIM_YES)
163 #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
164 if (p_confirm || cmdmod.confirm)
166 ! char_u buff[DIALOG_MSG_SIZE];
168 dialog_msg(buff, _("Overwrite existing file \"%s\"?"), fname);
169 if (vim_dialog_yesno(VIM_QUESTION, NULL, buff, 2) != VIM_YES)
172 /* For ":w! filename" check that no swap file exists for "filename". */
173 if (other && !emsg_silent)
175 ! char_u dir[MAXPATHL];
180 /* For ":w! filename" check that no swap file exists for "filename". */
181 if (other && !emsg_silent)
189 * Use 'shortname' of the current buffer, since there is no buffer
190 * for the written file. */
196 copy_option_part(&p, dir, MAXPATHL, ",");
198 swapname = makeswapname(fname, ffname, curbuf, dir);
199 r = vim_fexists(swapname);
202 #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
203 if (p_confirm || cmdmod.confirm)
205 ! char_u buff[IOSIZE];
208 _("Swap file \"%s\" exists, overwrite anyway?"),
210 * Use 'shortname' of the current buffer, since there is no buffer
211 * for the written file. */
221 + dir = alloc(MAXPATHL);
225 copy_option_part(&p, dir, MAXPATHL, ",");
227 swapname = makeswapname(fname, ffname, curbuf, dir);
229 r = vim_fexists(swapname);
232 #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
233 if (p_confirm || cmdmod.confirm)
235 ! char_u buff[DIALOG_MSG_SIZE];
238 _("Swap file \"%s\" exists, overwrite anyway?"),
241 #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
242 if ((p_confirm || cmdmod.confirm) && buf->b_fname != NULL)
244 ! char_u buff[IOSIZE];
247 dialog_msg(buff, _("'readonly' option is set for \"%s\".\nDo you wish to write anyway?"),
249 #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
250 if ((p_confirm || cmdmod.confirm) && buf->b_fname != NULL)
252 ! char_u buff[DIALOG_MSG_SIZE];
255 dialog_msg(buff, _("'readonly' option is set for \"%s\".\nDo you wish to write anyway?"),
256 *** ../vim-7.3.160/src/ex_cmds2.c 2011-02-25 14:46:06.000000000 +0100
257 --- src/ex_cmds2.c 2011-04-11 20:51:40.000000000 +0200
261 int checkall; /* may abandon all changed buffers */
263 ! char_u buff[IOSIZE];
269 int checkall; /* may abandon all changed buffers */
271 ! char_u buff[DIALOG_MSG_SIZE];
275 *** ../vim-7.3.160/src/ex_docmd.c 2011-04-11 16:56:29.000000000 +0200
276 --- src/ex_docmd.c 2011-04-11 21:20:35.000000000 +0200
279 #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
280 if ((p_confirm || cmdmod.confirm) && curbuf->b_fname != NULL)
282 ! char_u buff[IOSIZE];
286 (char_u *)_("1 more file to edit. Quit anyway?"),
289 ! vim_snprintf((char *)buff, IOSIZE,
290 _("%d more files to edit. Quit anyway?"), n);
291 if (vim_dialog_yesno(VIM_QUESTION, NULL, buff, 1) == VIM_YES)
294 #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
295 if ((p_confirm || cmdmod.confirm) && curbuf->b_fname != NULL)
297 ! char_u buff[DIALOG_MSG_SIZE];
301 (char_u *)_("1 more file to edit. Quit anyway?"),
302 ! DIALOG_MSG_SIZE - 1);
304 ! vim_snprintf((char *)buff, DIALOG_MSG_SIZE,
305 _("%d more files to edit. Quit anyway?"), n);
306 if (vim_dialog_yesno(VIM_QUESTION, NULL, buff, 1) == VIM_YES)
311 if (eap->cmdidx == CMD_mksession)
313 ! char_u dirnow[MAXPATHL]; /* current directory */
316 ! * Change to session file's dir.
318 ! if (mch_dirname(dirnow, MAXPATHL) == FAIL
319 ! || mch_chdir((char *)dirnow) != 0)
321 ! if (*dirnow != NUL && (ssop_flags & SSOP_SESDIR))
323 ! if (vim_chdirfile(fname) == OK)
324 ! shorten_fnames(TRUE);
326 ! else if (*dirnow != NUL
327 ! && (ssop_flags & SSOP_CURDIR) && globaldir != NULL)
329 ! if (mch_chdir((char *)globaldir) == 0)
330 ! shorten_fnames(TRUE);
333 ! failed |= (makeopens(fd, dirnow) == FAIL);
335 ! /* restore original dir */
336 ! if (*dirnow != NUL && ((ssop_flags & SSOP_SESDIR)
337 || ((ssop_flags & SSOP_CURDIR) && globaldir != NULL)))
339 ! if (mch_chdir((char *)dirnow) != 0)
340 ! EMSG(_(e_prev_dir));
341 ! shorten_fnames(TRUE);
347 if (eap->cmdidx == CMD_mksession)
349 ! char_u *dirnow; /* current directory */
351 ! dirnow = alloc(MAXPATHL);
352 ! if (dirnow == NULL)
357 ! * Change to session file's dir.
359 ! if (mch_dirname(dirnow, MAXPATHL) == FAIL
360 ! || mch_chdir((char *)dirnow) != 0)
362 ! if (*dirnow != NUL && (ssop_flags & SSOP_SESDIR))
364 ! if (vim_chdirfile(fname) == OK)
365 ! shorten_fnames(TRUE);
367 ! else if (*dirnow != NUL
368 ! && (ssop_flags & SSOP_CURDIR) && globaldir != NULL)
370 ! if (mch_chdir((char *)globaldir) == 0)
371 ! shorten_fnames(TRUE);
374 ! failed |= (makeopens(fd, dirnow) == FAIL);
376 ! /* restore original dir */
377 ! if (*dirnow != NUL && ((ssop_flags & SSOP_SESDIR)
378 || ((ssop_flags & SSOP_CURDIR) && globaldir != NULL)))
380 ! if (mch_chdir((char *)dirnow) != 0)
381 ! EMSG(_(e_prev_dir));
382 ! shorten_fnames(TRUE);
390 else if (eap->cmdidx == CMD_mksession)
392 /* successful session write - set this_session var */
393 ! char_u tbuf[MAXPATHL];
395 ! if (vim_FullName(fname, tbuf, MAXPATHL, FALSE) == OK)
396 ! set_vim_var_string(VV_THIS_SESSION, tbuf, -1);
401 else if (eap->cmdidx == CMD_mksession)
403 /* successful session write - set this_session var */
406 ! tbuf = alloc(MAXPATHL);
409 ! if (vim_FullName(fname, tbuf, MAXPATHL, FALSE) == OK)
410 ! set_vim_var_string(VV_THIS_SESSION, tbuf, -1);
421 ! char_u buf[MAXPATHL];
424 if (gap->ga_len == 0)
429 ! char_u *buf = NULL;
432 if (gap->ga_len == 0)
438 ! (void)vim_FullName(s, buf, MAXPATHL, FALSE);
441 if (fputs(" ", fd) < 0 || ses_put_fname(fd, s, flagp) == FAIL)
450 ! buf = alloc(MAXPATHL);
453 ! (void)vim_FullName(s, buf, MAXPATHL, FALSE);
457 if (fputs(" ", fd) < 0 || ses_put_fname(fd, s, flagp) == FAIL)
469 #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG) || defined(PROTO)
471 ! * Make a dialog message in "buff[IOSIZE]".
472 * "format" must contain "%s".
477 #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG) || defined(PROTO)
479 ! * Make a dialog message in "buff[DIALOG_MSG_SIZE]".
480 * "format" must contain "%s".
487 fname = (char_u *)_("Untitled");
488 ! vim_snprintf((char *)buff, IOSIZE, format, fname);
495 fname = (char_u *)_("Untitled");
496 ! vim_snprintf((char *)buff, DIALOG_MSG_SIZE, format, fname);
500 *** ../vim-7.3.160/src/fileio.c 2011-02-25 16:52:13.000000000 +0100
501 --- src/fileio.c 2011-04-11 18:35:10.000000000 +0200
504 shorten_fname1(full_path)
507 ! char_u dirname[MAXPATHL];
508 char_u *p = full_path;
510 if (mch_dirname(dirname, MAXPATHL) == OK)
512 p = shorten_fname(full_path, dirname);
513 if (p == NULL || *p == NUL)
520 shorten_fname1(full_path)
524 char_u *p = full_path;
526 + dirname = alloc(MAXPATHL);
527 + if (dirname == NULL)
529 if (mch_dirname(dirname, MAXPATHL) == OK)
531 p = shorten_fname(full_path, dirname);
532 if (p == NULL || *p == NUL)
539 *** ../vim-7.3.160/src/hardcopy.c 2011-04-11 16:56:29.000000000 +0200
540 --- src/hardcopy.c 2011-04-11 18:23:38.000000000 +0200
544 struct prt_ps_resource_S *resource;
546 ! char_u buffer[MAXPATHL + 1];
548 vim_strncpy(resource->name, (char_u *)name, 63);
549 /* Look for named resource file in runtimepath */
552 struct prt_ps_resource_S *resource;
557 ! buffer = alloc(MAXPATHL + 1);
558 ! if (buffer == NULL)
561 vim_strncpy(resource->name, (char_u *)name, 63);
562 /* Look for named resource file in runtimepath */
565 vim_strcat(buffer, (char_u *)name, MAXPATHL);
566 vim_strcat(buffer, (char_u *)".ps", MAXPATHL);
567 resource->filename[0] = NUL;
568 ! return (do_in_runtimepath(buffer, FALSE, prt_resource_name,
570 && resource->filename[0] != NUL);
573 /* PS CR and LF characters have platform independent values */
575 vim_strcat(buffer, (char_u *)name, MAXPATHL);
576 vim_strcat(buffer, (char_u *)".ps", MAXPATHL);
577 resource->filename[0] = NUL;
578 ! retval = (do_in_runtimepath(buffer, FALSE, prt_resource_name,
580 && resource->filename[0] != NUL);
585 /* PS CR and LF characters have platform independent values */
591 ! struct prt_ps_resource_S res_prolog;
592 ! struct prt_ps_resource_S res_encoding;
597 ! struct prt_ps_resource_S res_cidfont;
598 ! struct prt_ps_resource_S res_cmap;
602 * PS DSC Header comments - no PS code!
607 ! struct prt_ps_resource_S *res_prolog;
608 ! struct prt_ps_resource_S *res_encoding;
613 ! struct prt_ps_resource_S *res_cidfont;
614 ! struct prt_ps_resource_S *res_cmap;
616 + int retval = FALSE;
618 + res_prolog = (struct prt_ps_resource_S *)
619 + alloc(sizeof(struct prt_ps_resource_S));
620 + res_encoding = (struct prt_ps_resource_S *)
621 + alloc(sizeof(struct prt_ps_resource_S));
623 + res_cidfont = (struct prt_ps_resource_S *)
624 + alloc(sizeof(struct prt_ps_resource_S));
625 + res_cmap = (struct prt_ps_resource_S *)
626 + alloc(sizeof(struct prt_ps_resource_S));
628 + if (res_prolog == NULL || res_encoding == NULL
630 + || res_cidfont == NULL || res_cmap == NULL
636 * PS DSC Header comments - no PS code!
641 /* Search for external resources VIM supplies */
642 ! if (!prt_find_resource("prolog", &res_prolog))
644 EMSG(_("E456: Can't find PostScript resource file \"prolog.ps\""));
647 ! if (!prt_open_resource(&res_prolog))
649 ! if (!prt_check_resource(&res_prolog, PRT_PROLOG_VERSION))
654 /* Look for required version of multi-byte printing procset */
655 ! if (!prt_find_resource("cidfont", &res_cidfont))
657 EMSG(_("E456: Can't find PostScript resource file \"cidfont.ps\""));
660 ! if (!prt_open_resource(&res_cidfont))
662 ! if (!prt_check_resource(&res_cidfont, PRT_CID_PROLOG_VERSION))
669 /* Search for external resources VIM supplies */
670 ! if (!prt_find_resource("prolog", res_prolog))
672 EMSG(_("E456: Can't find PostScript resource file \"prolog.ps\""));
675 ! if (!prt_open_resource(res_prolog))
677 ! if (!prt_check_resource(res_prolog, PRT_PROLOG_VERSION))
682 /* Look for required version of multi-byte printing procset */
683 ! if (!prt_find_resource("cidfont", res_cidfont))
685 EMSG(_("E456: Can't find PostScript resource file \"cidfont.ps\""));
688 ! if (!prt_open_resource(res_cidfont))
690 ! if (!prt_check_resource(res_cidfont, PRT_CID_PROLOG_VERSION))
697 p_encoding = enc_skip(p_penc);
698 if (*p_encoding == NUL
699 ! || !prt_find_resource((char *)p_encoding, &res_encoding))
701 /* 'printencoding' not set or not supported - find alternate */
705 p_encoding = enc_skip(p_penc);
706 if (*p_encoding == NUL
707 ! || !prt_find_resource((char *)p_encoding, res_encoding))
709 /* 'printencoding' not set or not supported - find alternate */
713 p_encoding = enc_skip(p_enc);
714 props = enc_canon_props(p_encoding);
715 if (!(props & ENC_8BIT)
716 ! || !prt_find_resource((char *)p_encoding, &res_encoding))
717 /* 8-bit 'encoding' is not supported */
720 /* Use latin1 as default printing encoding */
721 p_encoding = (char_u *)"latin1";
722 ! if (!prt_find_resource((char *)p_encoding, &res_encoding))
724 EMSG2(_("E456: Can't find PostScript resource file \"%s.ps\""),
727 p_encoding = enc_skip(p_enc);
728 props = enc_canon_props(p_encoding);
729 if (!(props & ENC_8BIT)
730 ! || !prt_find_resource((char *)p_encoding, res_encoding))
731 /* 8-bit 'encoding' is not supported */
734 /* Use latin1 as default printing encoding */
735 p_encoding = (char_u *)"latin1";
736 ! if (!prt_find_resource((char *)p_encoding, res_encoding))
738 EMSG2(_("E456: Can't find PostScript resource file \"%s.ps\""),
745 ! if (!prt_open_resource(&res_encoding))
747 /* For the moment there are no checks on encoding resource files to
753 ! if (!prt_open_resource(res_encoding))
755 /* For the moment there are no checks on encoding resource files to
761 /* Include ASCII range encoding vector */
762 ! if (!prt_find_resource(prt_ascii_encoding, &res_encoding))
764 EMSG2(_("E456: Can't find PostScript resource file \"%s.ps\""),
768 ! if (!prt_open_resource(&res_encoding))
770 /* For the moment there are no checks on encoding resource files to
775 /* Include ASCII range encoding vector */
776 ! if (!prt_find_resource(prt_ascii_encoding, res_encoding))
778 EMSG2(_("E456: Can't find PostScript resource file \"%s.ps\""),
782 ! if (!prt_open_resource(res_encoding))
784 /* For the moment there are no checks on encoding resource files to
788 if (prt_out_mbyte && prt_custom_cmap)
790 /* Find user supplied CMap */
791 ! if (!prt_find_resource(prt_cmap, &res_cmap))
793 EMSG2(_("E456: Can't find PostScript resource file \"%s.ps\""),
797 ! if (!prt_open_resource(&res_cmap))
802 /* List resources supplied */
803 ! STRCPY(buffer, res_prolog.title);
805 ! STRCAT(buffer, res_prolog.version);
806 prt_dsc_resources("DocumentSuppliedResources", "procset", buffer);
810 ! STRCPY(buffer, res_cidfont.title);
812 ! STRCAT(buffer, res_cidfont.version);
813 prt_dsc_resources(NULL, "procset", buffer);
817 ! STRCPY(buffer, res_cmap.title);
819 ! STRCAT(buffer, res_cmap.version);
820 prt_dsc_resources(NULL, "cmap", buffer);
823 if (!prt_out_mbyte || prt_use_courier)
826 ! STRCPY(buffer, res_encoding.title);
828 ! STRCAT(buffer, res_encoding.version);
829 prt_dsc_resources(NULL, "encoding", buffer);
831 prt_dsc_requirements(prt_duplex, prt_tumble, prt_collate,
833 if (prt_out_mbyte && prt_custom_cmap)
835 /* Find user supplied CMap */
836 ! if (!prt_find_resource(prt_cmap, res_cmap))
838 EMSG2(_("E456: Can't find PostScript resource file \"%s.ps\""),
842 ! if (!prt_open_resource(res_cmap))
847 /* List resources supplied */
848 ! STRCPY(buffer, res_prolog->title);
850 ! STRCAT(buffer, res_prolog->version);
851 prt_dsc_resources("DocumentSuppliedResources", "procset", buffer);
855 ! STRCPY(buffer, res_cidfont->title);
857 ! STRCAT(buffer, res_cidfont->version);
858 prt_dsc_resources(NULL, "procset", buffer);
862 ! STRCPY(buffer, res_cmap->title);
864 ! STRCAT(buffer, res_cmap->version);
865 prt_dsc_resources(NULL, "cmap", buffer);
868 if (!prt_out_mbyte || prt_use_courier)
871 ! STRCPY(buffer, res_encoding->title);
873 ! STRCAT(buffer, res_encoding->version);
874 prt_dsc_resources(NULL, "encoding", buffer);
876 prt_dsc_requirements(prt_duplex, prt_tumble, prt_collate,
879 prt_dsc_noarg("BeginProlog");
881 /* Add required procsets - NOTE: order is important! */
882 ! if (!prt_add_resource(&res_prolog))
887 /* Add CID font procset, and any user supplied CMap */
888 ! if (!prt_add_resource(&res_cidfont))
890 ! if (prt_custom_cmap && !prt_add_resource(&res_cmap))
895 prt_dsc_noarg("BeginProlog");
897 /* Add required procsets - NOTE: order is important! */
898 ! if (!prt_add_resource(res_prolog))
903 /* Add CID font procset, and any user supplied CMap */
904 ! if (!prt_add_resource(res_cidfont))
906 ! if (prt_custom_cmap && !prt_add_resource(res_cmap))
913 /* There will be only one Roman font encoding to be included in the PS
915 ! if (!prt_add_resource(&res_encoding))
918 prt_dsc_noarg("EndProlog");
921 /* There will be only one Roman font encoding to be included in the PS
923 ! if (!prt_add_resource(res_encoding))
926 prt_dsc_noarg("EndProlog");
929 prt_dsc_noarg("EndSetup");
931 /* Fail if any problems writing out to the PS file */
932 ! return !prt_file_error;
937 prt_dsc_noarg("EndSetup");
939 /* Fail if any problems writing out to the PS file */
940 ! retval = !prt_file_error;
943 ! vim_free(res_prolog);
944 ! vim_free(res_encoding);
946 ! vim_free(res_cidfont);
947 ! vim_free(res_cmap);
954 *** ../vim-7.3.160/src/quickfix.c 2010-12-02 15:33:10.000000000 +0100
955 --- src/quickfix.c 2011-04-11 17:54:07.000000000 +0200
961 ! char_u dirname_start[MAXPATHL];
962 ! char_u dirname_now[MAXPATHL];
963 char_u *target_dir = NULL;
965 char_u *au_name = NULL;
970 ! char_u *dirname_start = NULL;
971 ! char_u *dirname_now = NULL;
972 char_u *target_dir = NULL;
974 char_u *au_name = NULL;
981 + dirname_start = alloc(MAXPATHL);
982 + dirname_now = alloc(MAXPATHL);
983 + if (dirname_start == NULL || dirname_now == NULL)
986 /* Remember the current directory, because a BufRead autocommand that does
987 * ":lcd %:p:h" changes the meaning of short path names. */
988 mch_dirname(dirname_start, MAXPATHL);
995 + vim_free(dirname_now);
996 + vim_free(dirname_start);
997 vim_free(target_dir);
998 vim_free(regmatch.regprog);
1000 *** ../vim-7.3.160/src/main.c 2011-03-22 18:10:34.000000000 +0100
1001 --- src/main.c 2011-04-11 18:06:06.000000000 +0200
1005 char_u *inicmd = NULL;
1007 ! char_u cwd[MAXPATHL];
1009 if (filec > 0 && filev[0][0] == '+')
1013 char_u *inicmd = NULL;
1017 if (filec > 0 && filev[0][0] == '+')
1021 mainerr_arg_missing((char_u *)filev[-1]);
1023 /* Temporarily cd to the current directory to handle relative file names. */
1024 if (mch_dirname(cwd, MAXPATHL) != OK)
1026 ! if ((p = vim_strsave_escaped_ext(cwd,
1027 #ifdef BACKSLASH_IN_FILENAME
1028 "", /* rem_backslash() will tell what chars to escape */
1032 ! '\\', TRUE)) == NULL)
1034 ga_init2(&ga, 1, 100);
1035 ga_concat(&ga, (char_u *)"<C-\\><C-N>:cd ");
1037 mainerr_arg_missing((char_u *)filev[-1]);
1039 /* Temporarily cd to the current directory to handle relative file names. */
1040 + cwd = alloc(MAXPATHL);
1043 if (mch_dirname(cwd, MAXPATHL) != OK)
1048 ! p = vim_strsave_escaped_ext(cwd,
1049 #ifdef BACKSLASH_IN_FILENAME
1050 "", /* rem_backslash() will tell what chars to escape */
1058 ga_init2(&ga, 1, 100);
1059 ga_concat(&ga, (char_u *)"<C-\\><C-N>:cd ");
1060 *** ../vim-7.3.160/src/netbeans.c 2011-04-11 16:56:29.000000000 +0200
1061 --- src/netbeans.c 2011-04-11 18:27:08.000000000 +0200
1067 ! char buf[MAXPATHL * 2 + 25];
1070 /* Don't do anything when 'ballooneval' is off, messages scrolled the
1078 /* Don't do anything when 'ballooneval' is off, messages scrolled the
1082 if (text != NULL && text[0] != NUL && STRLEN(text) < MAXPATHL)
1084 ! p = nb_quote(text);
1087 ! vim_snprintf(buf, sizeof(buf),
1088 ! "0:balloonText=%d \"%s\"\n", r_cmdno, p);
1091 - nbdebug(("EVT: %s", buf));
1092 - nb_send(buf, "netbeans_beval_cb");
1098 if (text != NULL && text[0] != NUL && STRLEN(text) < MAXPATHL)
1100 ! buf = (char *)alloc(MAXPATHL * 2 + 25);
1103 ! p = nb_quote(text);
1106 ! vim_snprintf(buf, MAXPATHL * 2 + 25,
1107 ! "0:balloonText=%d \"%s\"\n", r_cmdno, p);
1110 ! nbdebug(("EVT: %s", buf));
1111 ! nb_send(buf, "netbeans_beval_cb");
1117 *** ../vim-7.3.160/src/spell.c 2011-04-11 16:56:29.000000000 +0200
1118 --- src/spell.c 2011-04-11 18:00:49.000000000 +0200
1124 ! char_u fname[MAXPATHL];
1127 int free_slang = FALSE;
1132 ! char_u *fname = NULL;
1135 int free_slang = FALSE;
1139 * Write the .sug file.
1140 * Make the file name by changing ".spl" to ".sug".
1142 + fname = alloc(MAXPATHL);
1143 + if (fname == NULL)
1145 vim_strncpy(fname, wfname, MAXPATHL - 1);
1146 len = (int)STRLEN(fname);
1147 fname[len - 2] = 'u';
1151 sug_write(spin, fname);
1157 free_blocks(spin->si_blocks);
1160 int overwrite; /* overwrite existing output file */
1161 int added_word; /* invoked through "zg" */
1163 ! char_u fname[MAXPATHL];
1164 ! char_u wfname[MAXPATHL];
1167 afffile_T *(afile[8]);
1169 int overwrite; /* overwrite existing output file */
1170 int added_word; /* invoked through "zg" */
1172 ! char_u *fname = NULL;
1176 afffile_T *(afile[8]);
1180 innames = &fnames[1];
1181 incount = fcount - 1;
1183 + wfname = alloc(MAXPATHL);
1184 + if (wfname == NULL)
1189 len = (int)STRLEN(fnames[0]);
1192 * "path/en.latin1.add.spl". */
1193 innames = &fnames[0];
1195 ! vim_snprintf((char *)wfname, sizeof(wfname), "%s.spl", fnames[0]);
1197 else if (fcount == 1)
1199 /* For ":mkspell path/vim" output file is "path/vim.latin1.spl". */
1200 innames = &fnames[0];
1202 ! vim_snprintf((char *)wfname, sizeof(wfname), SPL_FNAME_TMPL,
1203 fnames[0], spin.si_ascii ? (char_u *)"ascii" : spell_enc());
1205 else if (len > 4 && STRCMP(fnames[0] + len - 4, ".spl") == 0)
1207 /* Name ends in ".spl", use as the file name. */
1208 ! vim_strncpy(wfname, fnames[0], sizeof(wfname) - 1);
1211 /* Name should be language, make the file name from it. */
1212 ! vim_snprintf((char *)wfname, sizeof(wfname), SPL_FNAME_TMPL,
1213 fnames[0], spin.si_ascii ? (char_u *)"ascii" : spell_enc());
1215 /* Check for .ascii.spl. */
1217 * "path/en.latin1.add.spl". */
1218 innames = &fnames[0];
1220 ! vim_snprintf((char *)wfname, MAXPATHL, "%s.spl", fnames[0]);
1222 else if (fcount == 1)
1224 /* For ":mkspell path/vim" output file is "path/vim.latin1.spl". */
1225 innames = &fnames[0];
1227 ! vim_snprintf((char *)wfname, MAXPATHL, SPL_FNAME_TMPL,
1228 fnames[0], spin.si_ascii ? (char_u *)"ascii" : spell_enc());
1230 else if (len > 4 && STRCMP(fnames[0] + len - 4, ".spl") == 0)
1232 /* Name ends in ".spl", use as the file name. */
1233 ! vim_strncpy(wfname, fnames[0], MAXPATHL - 1);
1236 /* Name should be language, make the file name from it. */
1237 ! vim_snprintf((char *)wfname, MAXPATHL, SPL_FNAME_TMPL,
1238 fnames[0], spin.si_ascii ? (char_u *)"ascii" : spell_enc());
1240 /* Check for .ascii.spl. */
1243 if (!overwrite && mch_stat((char *)wfname, &st) >= 0)
1248 if (mch_isdir(wfname))
1250 EMSG2(_(e_isadir2), wfname);
1255 * Init the aff and dic pointers.
1256 * Get the region names if there are more than 2 arguments.
1258 if (!overwrite && mch_stat((char *)wfname, &st) >= 0)
1263 if (mch_isdir(wfname))
1265 EMSG2(_(e_isadir2), wfname);
1269 + fname = alloc(MAXPATHL);
1270 + if (fname == NULL)
1274 * Init the aff and dic pointers.
1275 * Get the region names if there are more than 2 arguments.
1278 || innames[i][len - 3] != '_')
1280 EMSG2(_("E755: Invalid region in %s"), innames[i]);
1283 spin.si_region_name[i * 2] = TOLOWER_ASC(innames[i][len - 2]);
1284 spin.si_region_name[i * 2 + 1] =
1286 || innames[i][len - 3] != '_')
1288 EMSG2(_("E755: Invalid region in %s"), innames[i]);
1291 spin.si_region_name[i * 2] = TOLOWER_ASC(innames[i][len - 2]);
1292 spin.si_region_name[i * 2 + 1] =
1295 || spin.si_prefroot == NULL)
1297 free_blocks(spin.si_blocks);
1301 /* When not producing a .add.spl file clear the character table when
1303 || spin.si_prefroot == NULL)
1305 free_blocks(spin.si_blocks);
1309 /* When not producing a .add.spl file clear the character table when
1312 spin.si_conv.vc_type = CONV_NONE;
1313 spin.si_region = 1 << i;
1315 ! vim_snprintf((char *)fname, sizeof(fname), "%s.aff", innames[i]);
1316 if (mch_stat((char *)fname, &st) >= 0)
1318 /* Read the .aff file. Will init "spin->si_conv" based on the
1320 spin.si_conv.vc_type = CONV_NONE;
1321 spin.si_region = 1 << i;
1323 ! vim_snprintf((char *)fname, MAXPATHL, "%s.aff", innames[i]);
1324 if (mch_stat((char *)fname, &st) >= 0)
1326 /* Read the .aff file. Will init "spin->si_conv" based on the
1331 /* Read the .dic file and store the words in the trees. */
1332 ! vim_snprintf((char *)fname, sizeof(fname), "%s.dic",
1334 if (spell_read_dic(&spin, fname, afile[i]) == FAIL)
1339 /* Read the .dic file and store the words in the trees. */
1340 ! vim_snprintf((char *)fname, MAXPATHL, "%s.dic",
1342 if (spell_read_dic(&spin, fname, afile[i]) == FAIL)
1347 spell_make_sugfile(&spin, wfname);
1360 int new_spf = FALSE;
1362 ! char_u fnamebuf[MAXPATHL];
1363 char_u line[MAXWLEN * 2];
1364 long fpos, fpos_next = 0;
1368 int new_spf = FALSE;
1370 ! char_u *fnamebuf = NULL;
1371 char_u line[MAXWLEN * 2];
1372 long fpos, fpos_next = 0;
1377 EMSG2(_(e_notset), "spellfile");
1380 + fnamebuf = alloc(MAXPATHL);
1381 + if (fnamebuf == NULL)
1384 for (spf = curwin->w_s->b_p_spf, i = 1; *spf != NUL; ++i)
1391 EMSGN(_("E765: 'spellfile' does not have %ld entries"), idx);
1392 + vim_free(fnamebuf);
1399 if (buf != NULL && bufIsChanged(buf))
1401 EMSG(_(e_bufloaded));
1402 + vim_free(fnamebuf);
1410 redraw_all_later(SOME_VALID);
1412 + vim_free(fnamebuf);
1421 ! char_u buf[MAXPATHL];
1437 if (*curwin->w_s->b_p_spl != NUL && curwin->w_s->b_langp.ga_len > 0)
1439 + buf = alloc(MAXPATHL);
1443 /* Find the end of the language name. Exclude the region. If there
1444 * is a path separator remember the start of the tail. */
1445 for (lend = curwin->w_s->b_p_spl; *lend != NUL
1448 "/%.*s", (int)(lend - lstart), lstart);
1450 l = (int)STRLEN(buf);
1451 ! fname = LANGP_ENTRY(curwin->w_s->b_langp, 0)->lp_slang->sl_fname;
1452 vim_snprintf((char *)buf + l, MAXPATHL - l, ".%s.add",
1454 && strstr((char *)gettail(fname), ".ascii.") != NULL
1456 "/%.*s", (int)(lend - lstart), lstart);
1458 l = (int)STRLEN(buf);
1459 ! fname = LANGP_ENTRY(curwin->w_s->b_langp, 0)
1460 ! ->lp_slang->sl_fname;
1461 vim_snprintf((char *)buf + l, MAXPATHL - l, ".%s.add",
1463 && strstr((char *)gettail(fname), ".ascii.") != NULL
1475 *** ../vim-7.3.160/src/tag.c 2011-04-11 16:56:29.000000000 +0200
1476 --- src/tag.c 2011-04-11 20:54:36.000000000 +0200
1481 char_u tag_name[128 + 1];
1482 ! char_u fname[MAXPATHL + 1];
1483 ! char_u cmd[CMDBUFFSIZE + 1];
1486 * Add the matching tags to the location list for the current
1490 list = list_alloc();
1494 for (i = 0; i < num_matches; ++i)
1499 char_u tag_name[128 + 1];
1504 * Add the matching tags to the location list for the current
1508 + fname = alloc(MAXPATHL + 1);
1509 + cmd = alloc(CMDBUFFSIZE + 1);
1510 list = list_alloc();
1511 ! if (list == NULL || fname == NULL || cmd == NULL)
1516 ! list_free(list, TRUE);
1520 for (i = 0; i < num_matches; ++i)
1525 set_errorlist(curwin, list, ' ', IObuff);
1527 list_free(list, TRUE);
1531 cur_match = 0; /* Jump to the first tag */
1535 char_u *start; /* start of the value */
1536 char_u *end; /* after the value; can be NULL */
1538 ! char_u buf[MAXPATHL];
1541 /* check that the field name doesn't exist yet */
1542 if (dict_find(dict, (char_u *)field_name, -1) != NULL)
1544 char_u *start; /* start of the value */
1545 char_u *end; /* after the value; can be NULL */
1551 /* check that the field name doesn't exist yet */
1552 if (dict_find(dict, (char_u *)field_name, -1) != NULL)
1559 + buf = alloc(MAXPATHL);
1569 len = (int)(end - start);
1570 ! if (len > (int)sizeof(buf) - 1)
1571 ! len = sizeof(buf) - 1;
1572 vim_strncpy(buf, start, len);
1575 ! return dict_add_nr_str(dict, field_name, 0L, buf);
1582 len = (int)(end - start);
1583 ! if (len > MAXPATHL - 1)
1584 ! len = MAXPATHL - 1;
1585 vim_strncpy(buf, start, len);
1588 ! retval = dict_add_nr_str(dict, field_name, 0L, buf);
1594 *** ../vim-7.3.160/src/vim.h 2010-12-30 12:30:26.000000000 +0100
1595 --- src/vim.h 2011-04-11 20:50:54.000000000 +0200
1600 #define IOSIZE (1024+1) /* file i/o and sprintf buffer size */
1602 + #define DIALOG_MSG_SIZE 1000 /* buffer size for dialog_msg() */
1605 # define MSG_BUF_LEN 480 /* length of buffer for small messages */
1606 # define MSG_BUF_CLEN (MSG_BUF_LEN / 6) /* cell length (worst case: utf-8
1607 *** ../vim-7.3.160/src/xxd/xxd.c 2011-04-02 14:44:50.000000000 +0200
1608 --- src/xxd/xxd.c 2011-04-11 16:40:48.000000000 +0200
1611 int octspergrp = -1; /* number of octets grouped in output */
1612 int grplen; /* total chars per octet group */
1613 long length = -1, n = 0, seekoff = 0;
1619 int octspergrp = -1; /* number of octets grouped in output */
1620 int grplen; /* total chars per octet group */
1621 long length = -1, n = 0, seekoff = 0;
1622 ! static char l[LLEN+1]; /* static because it may be too big for stack */
1626 *** ../vim-7.3.160/src/version.c 2011-04-11 16:56:29.000000000 +0200
1627 --- src/version.c 2011-04-11 21:15:33.000000000 +0200
1631 { /* Add new patch number below this line */
1637 The process for understanding customers primarily involves sitting around with
1638 other marketing people and talking about what you would to if you were dumb
1639 enough to be a customer.
1640 (Scott Adams - The Dilbert principle)
1642 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
1643 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
1644 \\\ an exciting new programming language -- http://www.Zimbu.org ///
1645 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///