]> granicus.if.org Git - vim/commitdiff
updated for version 7.0073
authorBram Moolenaar <Bram@vim.org>
Thu, 19 May 2005 21:00:46 +0000 (21:00 +0000)
committerBram Moolenaar <Bram@vim.org>
Thu, 19 May 2005 21:00:46 +0000 (21:00 +0000)
24 files changed:
runtime/doc/if_mzsch.txt
runtime/doc/tags
src/Makefile
src/charset.c
src/config.h.in
src/configure.in
src/ex_eval.c
src/fileio.c
src/gui.c
src/gui_mac.c
src/gui_riscos.c
src/gui_xmdlg.c
src/if_cscope.c
src/mbyte.c
src/misc2.c
src/os_mswin.c
src/os_unix.c
src/os_vms_mms.c
src/os_win32.h
src/quickfix.c
src/tag.c
src/version.h
src/workshop.c
src/wsdebug.c

index bb82c174428d4ee58ba7ad7d8f99c0260acf5fc6..0580891e2420063179783f2c59f0c41a09466a64 100644 (file)
@@ -1,4 +1,4 @@
-*if_mzsch.txt*  For Vim version 7.0aa.  Last change: 2005 Jan 23
+*if_mzsch.txt*  For Vim version 7.0aa.  Last change: 2005 May 08
 
 
                  VIM REFERENCE MANUAL    by Sergey Khorev
@@ -110,6 +110,9 @@ something like this in your .vimrc (EOFs should not have indentation): >
 <
 
 The global namespace just instantiated this module with the prefix "vimext:".
+                                                       *mzscheme-sandbox*
+When executed in the |sandbox|, access to some filesystem and Vim interface
+procedures is restricted.
 
 ==============================================================================
 2. Examples                                            *mzscheme-examples*
index 3593dccc5ffb100b08626738b1e0615098302c39..8c7fb1ce0ab302a27eaf3d23ee712d721b9b44d3 100644 (file)
@@ -5117,7 +5117,6 @@ hebrew    hebrew.txt      /*hebrew*
 hebrew.txt     hebrew.txt      /*hebrew.txt*
 help   various.txt     /*help*
 help-context   help.txt        /*help-context*
-help-tags      tags    1
 help-translated        various.txt     /*help-translated*
 help-xterm-window      various.txt     /*help-xterm-window*
 help.txt       help.txt        /*help.txt*
@@ -5550,6 +5549,7 @@ matchend()        eval.txt        /*matchend()*
 matchit-install        usr_05.txt      /*matchit-install*
 matchlist()    eval.txt        /*matchlist()*
 matchstr()     eval.txt        /*matchstr()*
+mathematica-syntax     syntax.txt      /*mathematica-syntax*
 max()  eval.txt        /*max()*
 mbyte-IME      mbyte.txt       /*mbyte-IME*
 mbyte-XIM      mbyte.txt       /*mbyte-XIM*
@@ -5579,6 +5579,8 @@ minimal-features  os_msdos.txt    /*minimal-features*
 missing-options        vi_diff.txt     /*missing-options*
 mkdir()        eval.txt        /*mkdir()*
 mlang.txt      mlang.txt       /*mlang.txt*
+mma-syntax     syntax.txt      /*mma-syntax*
+mma.vim        syntax.txt      /*mma.vim*
 mode() eval.txt        /*mode()*
 mode-Ex        intro.txt       /*mode-Ex*
 mode-cmdline   cmdline.txt     /*mode-cmdline*
index 6ca8a6bf3bdbbff142b6ac3ded175c461d863aab..d61ac9179ecf51bd9e7db33e80ec603c85f3663e 100644 (file)
@@ -1225,8 +1225,10 @@ CPP_DEPEND = $(CC) -I$(srcdir) -M$(CPP_MM) $(DEPEND_CFLAGS)
 # flags for cproto
 #     This is for cproto 3 patchlevel 8 or below
 #     __inline, __attribute__ and __extension__ are not recognized by cproto
-NO_ATTR = -D__inline= -D"__attribute__\\(x\\)=" -D"__asm__\\(x\\)=" -D__extension__= \
--D__restrict="" -D__gnuc_va_list=char -D__builtin_va_list=char
+NO_ATTR = -D__inline= -D__inline__= -DG_IMPLEMENT_INLINES \
+         -D"__attribute__\\(x\\)=" -D"__asm__\\(x\\)=" \
+         -D__extension__= -D__restrict="" \
+         -D__gnuc_va_list=char -D__builtin_va_list=char
 
 #
 #     This is for cproto 3 patchlevel 9 or above (currently 4.6)
@@ -1259,7 +1261,9 @@ POST_DEFS = $(X_CFLAGS) $(MZSCHEME_CFLAGS) $(PERL_CFLAGS) $(PYTHON_CFLAGS) $(TCL
 
 ALL_CFLAGS = $(PRE_DEFS) $(CFLAGS) $(PROFILE_CFLAGS) $(POST_DEFS)
 
-LINT_CFLAGS = -DLINT -I. $(PRE_DEFS) $(POST_DEFS) -Dinline= -D__extension__= -Dalloca=alloca -D"__attribute__(x)="
+LINT_CFLAGS = -DLINT -I. $(PRE_DEFS) $(POST_DEFS) -Dinline= -D__extension__= -Dalloca=alloca
+
+LINT_EXTRA = -DUSE_SNIFF -DHANGUL_INPUT -D"__attribute__(x)="
 
 DEPEND_CFLAGS = -DPROTO -DDEPEND -DFEAT_GUI $(LINT_CFLAGS)
 
@@ -2172,7 +2176,7 @@ depend:
 
 # Run lint.  Clean up the *.ln files that are sometimes left behind.
 lint:
-       lint $(LINT_OPTIONS) $(LINT_CFLAGS) -DUSE_SNIFF -DHANGUL_INPUT $(LINT_SRC)
+       lint $(LINT_OPTIONS) $(LINT_CFLAGS) $(LINT_EXTRA) $(LINT_SRC)
        -rm -f *.ln
 
 # Check dosinst.c with lint.
index c198284476fdca3a5eb8f3e6455400246878d066..c05a83d26a5c845db186149cf5d727032220801e 100644 (file)
@@ -1005,6 +1005,7 @@ init_spell_chartab()
     }
 }
 
+#if defined(FEAT_MBYTE) || defined(PROTO)
 static char *e_affform = N_("E761: Format error in affix file FOL, LOW or UPP");
 static char *e_affrange = N_("E762: Character in FOL, LOW or UPP is out of range");
 
@@ -1083,6 +1084,7 @@ set_spell_chartab(fol, low, upp)
 
     return set_spell_finish(&new_st);
 }
+#endif
 
 /*
  * Set the spell character tables from strings in the .spl file.
index 0ecc7b1ec57b2ce43fd1fb89ab50dfa64b04304c..5adbcb970aa90ba5aec28a76aca6b7eebe161688 100644 (file)
 #undef HAVE_SIGSETJMP
 #undef HAVE_SIGSTACK
 #undef HAVE_SIGVEC
-#undef HAVE_SNPRINTF
 #undef HAVE_STRCASECMP
 #undef HAVE_STRERROR
 #undef HAVE_STRFTIME
 
 /* Define if you want XSMP interaction as well as vanilla swapfile safety */
 #undef USE_XSMP_INTERACT
-
-/* Define if vsnprintf() works */
-#undef HAVE_VSNPRINTF
index 27828850a775789deb2b0a62e9cbe4f5caae49f0..12d11900e4fdd1bf37eba8539fa581dd89f9658e 100644 (file)
@@ -2636,7 +2636,7 @@ AC_CHECK_FUNCS(bcmp fchdir fchown fseeko fsync ftello getcwd getpseudotty \
        getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \
        memset nanosleep opendir putenv qsort readlink select setenv \
        setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
-       sigvec snprintf strcasecmp strerror strftime stricmp strncasecmp \
+       sigvec strcasecmp strerror strftime stricmp strncasecmp \
        strnicmp strpbrk strtol tgetent towlower towupper iswupper \
        usleep utime utimes)
 
@@ -2777,30 +2777,6 @@ else
   AC_MSG_RESULT(yes)
 fi
 
-AC_MSG_CHECKING(for vsnprintf())
-AC_TRY_RUN([
-#include <stdio.h>
-#include <stdarg.h>
-       /* Check use of vsnprintf() */
-       void warn(char *fmt, ...);
-       void warn(char *fmt, ...)
-       {
-         va_list ap; char buf[20];
-         va_start(ap, fmt);
-         vsnprintf(buf, 20, fmt, ap);
-         va_end(ap);
-       }
-       main()
-       {
-       warn("testing %s\n", "a very long string that won't fit");
-       exit(0);
-       }
-           ],
-       AC_DEFINE(HAVE_VSNPRINTF) AC_MSG_RESULT(yes),
-       AC_MSG_RESULT(no),
-       AC_MSG_ERROR(failed to compile test program))
-
-
 dnl rename needs to be checked separately to work on Nextstep with cc
 AC_MSG_CHECKING(for rename)
 AC_TRY_LINK([#include <stdio.h>], [rename("this", "that")],
index 6acf9de7df9068d6aea690293e6063f7dd974678..d6c4ebee784b96f1d48d3298dbea2daeebb4295e 100644 (file)
@@ -484,8 +484,8 @@ throw_exception(value, type, cmdname)
                                    || (VIM_ISDIGIT(p[3])
                                        && p[4] == ':'))))))
            {
-               if (*p == NUL || p == mesg)  /* 'E123' missing or at beginning */
-                   STRCAT(val, mesg);
+               if (*p == NUL || p == mesg)
+                   STRCAT(val, mesg);  /* 'E123' missing or at beginning */
                else
                {
                    /* '"filename" E123: message text' */
@@ -525,7 +525,7 @@ throw_exception(value, type, cmdname)
            msg_silent = FALSE;         /* display messages */
        ++no_wait_return;
        msg_scroll = TRUE;          /* always scroll up, don't overwrite */
-       msg_str((char_u *)_("Exception thrown: %s"), excp->value);
+       smsg((char_u *)_("Exception thrown: %s"), excp->value);
        msg_puts((char_u *)"\n");   /* don't overwrite this either */
        cmdline_row = msg_row;
        --no_wait_return;
@@ -571,7 +571,7 @@ discard_exception(excp, was_finished)
            msg_silent = FALSE;         /* display messages */
        ++no_wait_return;
        msg_scroll = TRUE;          /* always scroll up, don't overwrite */
-       msg_str(was_finished
+       smsg(was_finished
                    ? (char_u *)_("Exception finished: %s")
                    : (char_u *)_("Exception discarded: %s"),
                excp->value);
@@ -616,10 +616,10 @@ catch_exception(excp)
     if (*excp->throw_name != NUL)
     {
        if (excp->throw_lnum != 0)
-           sprintf((char *)IObuff, _("%s, line %ld"), excp->throw_name,
-                   (long)excp->throw_lnum);
+           vim_snprintf((char *)IObuff, IOSIZE, _("%s, line %ld"),
+                                   excp->throw_name, (long)excp->throw_lnum);
        else
-           STRCPY(IObuff, excp->throw_name);
+           vim_snprintf((char *)IObuff, IOSIZE, "%s", excp->throw_name);
        set_vim_var_string(VV_THROWPOINT, IObuff, -1);
     }
     else
@@ -634,7 +634,7 @@ catch_exception(excp)
            msg_silent = FALSE;         /* display messages */
        ++no_wait_return;
        msg_scroll = TRUE;          /* always scroll up, don't overwrite */
-       msg_str((char_u *)_("Exception caught: %s"), excp->value);
+       smsg((char_u *)_("Exception caught: %s"), excp->value);
        msg_puts((char_u *)"\n");   /* don't overwrite this either */
        cmdline_row = msg_row;
        --no_wait_return;
@@ -659,11 +659,12 @@ finish_exception(excp)
        if (*caught_stack->throw_name != NUL)
        {
            if (caught_stack->throw_lnum != 0)
-               sprintf((char *)IObuff,
+               vim_snprintf((char *)IObuff, IOSIZE,
                        _("%s, line %ld"), caught_stack->throw_name,
                        (long)caught_stack->throw_lnum);
            else
-               STRCPY(IObuff, caught_stack->throw_name);
+               vim_snprintf((char *)IObuff, IOSIZE, "%s",
+                                                   caught_stack->throw_name);
            set_vim_var_string(VV_THROWPOINT, IObuff, -1);
        }
        else
@@ -742,7 +743,8 @@ report_pending(action, pending, value)
        default:
            if (pending & CSTP_THROW)
            {
-               sprintf((char *)IObuff, (char *)mesg, _("Exception"));
+               vim_snprintf((char *)IObuff, IOSIZE,
+                                               (char *)mesg, _("Exception"));
                mesg = vim_strnsave(IObuff, (int)STRLEN(IObuff) + 4);
                STRCAT(mesg, ": %s");
                s = (char *)((except_T *)value)->value;
@@ -760,7 +762,7 @@ report_pending(action, pending, value)
        msg_silent = FALSE;     /* display messages */
     ++no_wait_return;
     msg_scroll = TRUE;         /* always scroll up, don't overwrite */
-    msg_str(mesg, (char_u *)s);
+    smsg(mesg, (char_u *)s);
     msg_puts((char_u *)"\n");   /* don't overwrite this either */
     cmdline_row = msg_row;
     --no_wait_return;
index d88111a13572251ffc7a7de94ef9403eb294fdb2..1f95d0e2e2c58ab4dbce14c2ad6b9a07fb66e59a 100644 (file)
@@ -8342,7 +8342,7 @@ auto_next_pat(apc, stop_at_last)
                    sprintf((char *)sourcing_name, s,
                                               (char *)name, (char *)ap->pat);
                    if (p_verbose >= 8)
-                       msg_str((char_u *)_("Executing %s"), sourcing_name);
+                       smsg((char_u *)_("Executing %s"), sourcing_name);
                }
 
                apc->curpat = ap;
@@ -8410,7 +8410,7 @@ getnextac(c, cookie, indent)
     if (p_verbose >= 9)
     {
        msg_scroll = TRUE;          /* always scroll up, don't overwrite */
-       msg_str((char_u *)_("autocommand %s"), ac->cmd);
+       smsg((char_u *)_("autocommand %s"), ac->cmd);
        msg_puts((char_u *)"\n");   /* don't overwrite this either */
        cmdline_row = msg_row;
     }
index 8cd43ac8f9af1780c5e00de4ca0ee193581ad46f..090160ad028b0b63146f0c1b2f636ac6511dade0 100644 (file)
--- a/src/gui.c
+++ b/src/gui.c
@@ -4359,7 +4359,7 @@ gui_find_bitmap(name, buffer, ext)
 {
     if (STRLEN(name) > MAXPATHL - 14)
        return FAIL;
-    sprintf((char *)buffer, "bitmaps/%s.%s", name, ext);
+    vim_snprintf((char *)buffer, MAXPATHL, "bitmaps/%s.%s", name, ext);
     if (do_in_runtimepath(buffer, FALSE, gfp_setname, buffer) == FAIL
                                                            || *buffer == NUL)
        return FAIL;
index e9a44b35d79474bdaff769d060e1de89b5db5bca..fbf9b30b7cddccc47a683c8c6d50bb9044f52714 100644 (file)
@@ -1644,7 +1644,7 @@ GetFontPanelSelection(char_u* outName)
 
        /* Only encode font size, because style (bold, italic, etc) is
         * already part of the font full name */
-       snprintf(styleString, FONT_STYLE_BUFFER_SIZE, ":h%d",
+       vim_snprintf(styleString, FONT_STYLE_BUFFER_SIZE, ":h%d",
                gFontPanelInfo.size/*,
                ((gFontPanelInfo.style & bold)!=0 ? ":b" : ""),
                ((gFontPanelInfo.style & italic)!=0 ? ":i" : ""),
index 2c40514fd6621cedf1db13e8470e861cff418dc8..2f334191c2c086f1066e0fa74dcad3f23234bd23 100644 (file)
@@ -3218,8 +3218,7 @@ gui_mch_call_shell(cmd, options)
        length = out_redir - cmd;
        out_file = fopen(out_redir + 3, "wb");
        if (out_file == NULL)
-           msg_str("WARNING : Can't open file %s for writing\n",
-                                                              out_redir + 3);
+           smsg("WARNING : Can't open file %s for writing\n", out_redir + 3);
     }
 
     if (length > 180)
index 66cb85477c811bda6088415f075e0564748655eb..dff867292a0d54c376d71e828239ef6e73c83325 100644 (file)
@@ -169,9 +169,9 @@ name_part(char *font, char *buf)
     get_part(font, 1, buf3);
 
     if (strlen(buf3))
-       sprintf(buf, "%s (%s)", buf2, buf3);
+       vim_snprintf(buf, TEMP_BUF_SIZE, "%s (%s)", buf2, buf3);
     else
-       sprintf(buf, "%s", buf2);
+       vim_snprintf(buf, TEMP_BUF_SIZE, "%s", buf2);
 }
 
 /*
@@ -188,23 +188,23 @@ style_part(char *font, char *buf)
 
     if (!strcmp(buf2, "normal") && !strcmp(buf2, "Normal")
                                                   && !strcmp(buf2, "NORMAL"))
-       sprintf(buf, "%s %s", buf3, buf2);
+       vim_snprintf(buf, TEMP_BUF_SIZE, "%s %s", buf3, buf2);
     else
        strcpy(buf, buf3);
 
     get_part(font, 6, buf2);
 
     if (buf2[0] != '\0')
-       sprintf(buf3, "%s %s", buf, buf2);
+       vim_snprintf(buf3, TEMP_BUF_SIZE, "%s %s", buf, buf2);
     else
        strcpy(buf3, buf);
 
     get_part(font, 4, buf2);
 
     if (!strcmp(buf2, "o") || !strcmp(buf2, "O"))
-       sprintf(buf, "%s oblique", buf3);
+       vim_snprintf(buf, TEMP_BUF_SIZE, "%s oblique", buf3);
     else if (!strcmp(buf2, "i") || !strcmp(buf2, "I"))
-       sprintf(buf, "%s italic", buf3);
+       vim_snprintf(buf, TEMP_BUF_SIZE, "%s italic", buf3);
 
     if (!strcmp(buf, " "))
        strcpy(buf, "-");
@@ -262,7 +262,7 @@ encoding_part(char *font, char *buf)
     get_part(font, 14, buf2);
 
     if (strlen(buf1) > 0 && strlen(buf2))
-       sprintf(buf, "%s-%s", buf1, buf2);
+       vim_snprintf(buf, TEMP_BUF_SIZE, "%s-%s", buf1, buf2);
     if (!strcmp(buf, " "))
        strcpy(buf, "-");
 }
@@ -551,7 +551,7 @@ stoggle_callback(Widget w,
        XmToggleButtonCallbackStruct *call_data)
 {
     int                i, do_sel;
-    char       newSize[10];
+    char       newSize[TEMP_BUF_SIZE];
     XmString   str;
 
     if (call_data->reason != (int)XmCR_VALUE_CHANGED)
index f4286e41200d0c2ed058b9417c701fb7d9e619b9..1b0771337ab0ecceacb44fff64ddebc8adf31615 100644 (file)
@@ -2125,7 +2125,7 @@ cs_reset(eap)
 {
     char       **dblist = NULL, **pplist = NULL, **fllist = NULL;
     int        i;
-    char buf[8]; /* for sprintf " (#%d)" */
+    char buf[20]; /* for sprintf " (#%d)" */
 
     /* malloc our db and ppath list */
     dblist = (char **)alloc(CSCOPE_MAX_CONNECTIONS * sizeof(char *));
index c7717886259a26fba02c18f2ca04a15416a5358d..3a8b5584c092ea7b62305b8678c77da2fc929ba8 100644 (file)
@@ -2255,6 +2255,7 @@ mb_strnicmp(s1, s2, n)
 show_utf8()
 {
     int                len;
+    int                rlen = 0;
     char_u     *line;
     int                clen;
     int                i;
@@ -2269,7 +2270,6 @@ show_utf8()
        return;
     }
 
-    IObuff[0] = NUL;
     clen = 0;
     for (i = 0; i < len; ++i)
     {
@@ -2277,11 +2277,17 @@ show_utf8()
        {
            /* start of (composing) character, get its length */
            if (i > 0)
-               STRCAT(IObuff, "+ ");
+           {
+               STRCPY(IObuff + rlen, "+ ");
+               rlen += 2;
+           }
            clen = utf_ptr2len_check(line + i);
        }
-       sprintf((char *)IObuff + STRLEN(IObuff), "%02x ", line[i]);
+       sprintf((char *)IObuff + rlen, "%02x ", line[i]);
        --clen;
+       rlen += STRLEN(IObuff + rlen);
+       if (rlen > IOSIZE - 20)
+           break;
     }
 
     msg(IObuff);
index a00d3ae49f54ae387502c15d6901198ef4f77e05..879384a6d8bbafe242d0363a966bba1fa2dcc7ed 100644 (file)
@@ -2606,7 +2606,7 @@ call_shell(cmd, opt)
 
     if (p_verbose > 3)
     {
-       msg_str((char_u *)_("Calling shell to execute: \"%s\""),
+       smsg((char_u *)_("Calling shell to execute: \"%s\""),
                                                    cmd == NULL ? p_sh : cmd);
        out_char('\n');
        cursor_on();
@@ -4076,8 +4076,8 @@ vim_findfile(search_ctx)
            {
                /* always scroll up, don't overwrite */
                msg_scroll = TRUE;
-               smsg((char_u *)"Searching: %s (%s)", ctx->ffs_fix_path,
-                       ctx->ffs_wc_path);
+               smsg((char_u *)"Searching: %s (%s)",
+                                        ctx->ffs_fix_path, ctx->ffs_wc_path);
                /* don't overwrite this either */
                msg_puts((char_u *)"\n");
                cmdline_row = msg_row;
@@ -4266,7 +4266,7 @@ vim_findfile(search_ctx)
                                    {
                                        /* always scroll up, don't overwrite */
                                        msg_scroll = TRUE;
-                                       msg_str((char_u *)"Already: %s",
+                                       smsg((char_u *)"Already: %s",
                                                                   file_path);
                                        /* don't overwrite this either */
                                        msg_puts((char_u *)"\n");
@@ -4295,7 +4295,7 @@ vim_findfile(search_ctx)
                                {
                                    /* always scroll up, don't overwrite */
                                    msg_scroll = TRUE;
-                                   msg_str((char_u *)"HIT: %s", file_path);
+                                   smsg((char_u *)"HIT: %s", file_path);
                                    /* don't overwrite this either */
                                    msg_puts((char_u *)"\n");
                                    cmdline_row = msg_row;
@@ -4485,7 +4485,7 @@ ff_get_visited_list(filename, list_headp)
                {
                    /* always scroll up, don't overwrite */
                    msg_scroll = TRUE;
-                   msg_str((char_u *)"ff_get_visited_list: FOUND list for %s",
+                   smsg((char_u *)"ff_get_visited_list: FOUND list for %s",
                                                                    filename);
                    /* don't overwrite this either */
                    msg_puts((char_u *)"\n");
@@ -4503,7 +4503,7 @@ ff_get_visited_list(filename, list_headp)
     {
        /* always scroll up, don't overwrite */
        msg_scroll = TRUE;
-       msg_str((char_u *)"ff_get_visited_list: new list for %s", filename);
+       smsg((char_u *)"ff_get_visited_list: new list for %s", filename);
        /* don't overwrite this either */
        msg_puts((char_u *)"\n");
        cmdline_row = msg_row;
@@ -5596,23 +5596,3 @@ vimpty_getenv(string)
 # endif
 
 #endif /* !defined(HAVE_SETENV) && !defined(HAVE_PUTENV) */
-
-/*
- * Print a message with one string argument.
- * Make sure that the result fits in IObuff.
- * This is not in message.c, because the prototype for smsg() isn't used
- * there.
- */
-    void
-msg_str(s, arg)
-    char_u     *s;
-    char_u     *arg;
-{
-    int                ls = STRLEN(s);
-    int                larg = STRLEN(arg);
-
-    if (ls + larg >= IOSIZE)
-       smsg(s, arg + (ls + larg - IOSIZE));
-    else
-       smsg(s, arg);
-}
index c833113db50b1201e397bf92c9d038f7d4a710ff..8a47dd16f128653725790a2b915633715bfe94b9 100644 (file)
@@ -3377,7 +3377,8 @@ get_logfont(
                        }
                    if (cp->name == NULL && verbose)
                    {
-                       sprintf((char *)IObuff, _("E244: Illegal charset name \"%s\" in font name \"%s\""), p, name);
+                       vim_snprintf((char *)IObuff, IOSIZE,
+                               _("E244: Illegal charset name \"%s\" in font name \"%s\""), p, name);
                        EMSG(IObuff);
                        break;
                    }
@@ -3386,7 +3387,7 @@ get_logfont(
            default:
                if (verbose)
                {
-                   sprintf((char *)IObuff,
+                   vim_snprintf((char *)IObuff, IOSIZE,
                            _("E245: Illegal char '%c' in font name \"%s\""),
                            p[-1], name);
                    EMSG(IObuff);
index 80735b69a09a08f1da17d0c801e7a851b52ec15c..f2aaf119eca2d2bdb0c2cc9217c2377e5521e979 100644 (file)
@@ -1307,7 +1307,7 @@ xopen_message(tvp)
     gettimeofday(&end_tv, NULL);
     smsg((char_u *)_("Opening the X display took %ld msec"),
            (end_tv.tv_sec - tvp->tv_sec) * 1000L
-           + (end_tv.tv_usec - tvp->tv_usec) / 1000L);
+                                  + (end_tv.tv_usec - tvp->tv_usec) / 1000L);
 }
 # endif
 #endif
@@ -2092,6 +2092,7 @@ mch_get_uname(uid, s, len)
            && pw->pw_name != NULL && *(pw->pw_name) != NUL)
     {
        STRNCPY(s, pw->pw_name, len);
+       s[len - 1] = NUL;
        return OK;
     }
 #endif
@@ -6453,8 +6454,9 @@ xsmp_init(void)
     if (xsmp.smcconn == NULL)
     {
        char errorreport[132];
-       sprintf(errorreport, _("XSMP SmcOpenConnection failed: %s"),
-               errorstring);
+
+       vim_snprintf(errorreport, sizeof(errorreport),
+                        _("XSMP SmcOpenConnection failed: %s"), errorstring);
        if (p_verbose > 0)
            MSG(errorreport);
        return;
index d653860be7c8260d355af8f2cf2d7ac22df81f89..4da7b1ad410cf22b81700bf3845e0cf680a5ec79 100644 (file)
@@ -40,7 +40,8 @@ int main(int argc, char *argv[])
            strcat(target, argp);
        }
     }
-    sprintf(cmd, "%s/output=tmp:errors.vim_tmp %s", mms, target);
+    vim_snprintf(cmd, sizeof(cmd), "%s/output=tmp:errors.vim_tmp %s",
+                                                                mms, target);
     system(cmd);
     fpi = fopen("tmp:errors.vim_tmp", "r");
     fpo = fopen(error_file, "w");
index 5554c0ca761528f71df8fa3a36c1ffb40d7b72fa..d9aaa6e54e2dec5dcb56338a65da86159ede6fd6 100644 (file)
@@ -24,7 +24,6 @@
 # define HAVE_STRING_H
 #endif
 #define HAVE_STRCSPN
-#define HAVE_VSNPRINTF
 #ifndef __GNUC__
 #define HAVE_STRICMP
 #define HAVE_STRNICMP
index e022c787a59625e48585770c9fc8c9327e4edaeb..a481b0f316dabb44a7819a109f46da42094a2ebc 100644 (file)
@@ -1478,7 +1478,8 @@ qf_list(eap)
                if (fname == NULL)
                    sprintf((char *)IObuff, "%2d", i);
                else
-                   sprintf((char *)IObuff, "%2d %s", i, (char *)fname);
+                   vim_snprintf((char *)IObuff, IOSIZE, "%2d %s",
+                                                           i, (char *)fname);
                msg_outtrans_attr(IObuff, i == qf_lists[qf_curlist].qf_index
                        ? hl_attr(HLF_L) : hl_attr(HLF_D));
                if (qfp->qf_lnum == 0)
index f9797de9e56a36c52ab8b6e9f9f14d12486cb239..8b7c4e240d91cbb7c3d2ad38cdf1c92acb987fda 100644 (file)
--- a/src/tag.c
+++ b/src/tag.c
@@ -598,7 +598,8 @@ do_tag(tag, type, count, forceit, verbose)
                        *IObuff = '>';
                    else
                        *IObuff = ' ';
-                   sprintf((char *)IObuff + 1, "%2d %s ", i + 1,
+                   vim_snprintf((char *)IObuff + 1, IOSIZE - 1,
+                           "%2d %s ", i + 1,
                                           mt_names[matches[i][0] & MT_MASK]);
                    msg_puts(IObuff);
                    if (tagp.tagkind != NULL)
@@ -807,8 +808,7 @@ do_tag(tag, type, count, forceit, verbose)
             * file didn't exist.  Otherwise an EMSG() is given below.
             */
            if (nofile_fname != NULL && error_cur_match != cur_match)
-               msg_str((char_u *)_("File \"%s\" does not exist"),
-                                                               nofile_fname);
+               smsg((char_u *)_("File \"%s\" does not exist"), nofile_fname);
 
 
            ic = (matches[cur_match][0] & MT_IC_OFF);
@@ -1360,7 +1360,7 @@ find_tags(pat, num_matches, matchesp, flags, mincount, buf_ffname)
                continue;
 
            if (p_verbose >= 5)
-               msg_str((char_u *)_("Searching tags file %s"), tag_fname);
+               smsg((char_u *)_("Searching tags file %s"), tag_fname);
        }
        did_open = TRUE;    /* remember that we found at least one file */
 
index 487e09f5e412d8049e0335fd9ce7b5cc6dfeb50e..b6d6137a6420618a7b676476f440005f3998a611 100644 (file)
@@ -36,5 +36,5 @@
 #define VIM_VERSION_NODOT      "vim70aa"
 #define VIM_VERSION_SHORT      "7.0aa"
 #define VIM_VERSION_MEDIUM     "7.0aa ALPHA"
-#define VIM_VERSION_LONG       "VIM - Vi IMproved 7.0aa ALPHA (2005 May 18)"
-#define VIM_VERSION_LONG_DATE  "VIM - Vi IMproved 7.0aa ALPHA (2005 May 18, compiled "
+#define VIM_VERSION_LONG       "VIM - Vi IMproved 7.0aa ALPHA (2005 May 19)"
+#define VIM_VERSION_LONG_DATE  "VIM - Vi IMproved 7.0aa ALPHA (2005 May 19, compiled "
index e17f0e64fa4e80c678ccfba3ede41d0316af1bc0..27323d4b1f07510c0c0fff17b89504e635a61966 100644 (file)
@@ -294,7 +294,7 @@ workshop_save_file(
 #endif
 
     /* Save the given file */
-    sprintf(cbuf, "w %s", filename);
+    vim_snprintf(cbuf, sizeof(cbuf), "w %s", filename);
     coloncmd(cbuf, TRUE);
 }
 
@@ -380,14 +380,16 @@ workshop_add_mark_type(
     {
        if (colorspec != NULL && *colorspec)
        {
-           sprintf(cbuf, "highlight WS%s guibg=%s", gbuf, colorspec);
+           vim_snprintf(cbuf, sizeof(cbuf),
+                                 "highlight WS%s guibg=%s", gbuf, colorspec);
            coloncmd(cbuf, FALSE);
-           sprintf(cibuf, "linehl=WS%s", gbuf);
+           vim_snprintf(cibuf, sizeof(cibuf), "linehl=WS%s", gbuf);
        }
        else
            cibuf[0] = NUL;
 
-       sprintf(cbuf, "sign define %d %s icon=%s", idx, cibuf, sign);
+       vim_snprintf(cbuf, sizeof(cbuf),
+                              "sign define %d %s icon=%s", idx, cibuf, sign);
        coloncmd(cbuf, TRUE);
     }
 }
@@ -408,7 +410,7 @@ workshop_set_mark(
                filename, lineno, markId, idx);
 #endif
 
-    sprintf(cbuf, "sign place %d line=%d name=%d file=%s",
+    vim_snprintf(cbuf, sizeof(cbuf), "sign place %d line=%d name=%d file=%s",
                                               markId, lineno, idx, filename);
     coloncmd(cbuf, TRUE);
 }
@@ -428,7 +430,8 @@ workshop_change_mark_type(
                filename, markId, idx);
 #endif
 
-    sprintf(cbuf, "sign place %d name=%d file=%s", markId, idx, filename);
+    vim_snprintf(cbuf, sizeof(cbuf),
+                     "sign place %d name=%d file=%s", markId, idx, filename);
     coloncmd(cbuf, TRUE);
 }
 
@@ -453,7 +456,7 @@ workshop_goto_mark(
                message : "<None>");
 #endif
 
-    sprintf(cbuf, "sign jump %d file=%s", markId, filename);
+    vim_snprintf(cbuf, sizeof(cbuf), "sign jump %d file=%s", markId, filename);
     coloncmd(cbuf, TRUE);
     if (message != NULL && *message != NUL)
        gui_mch_set_footer((char_u *)message);
@@ -473,7 +476,8 @@ workshop_delete_mark(
                filename, markId);
 #endif
 
-    sprintf(cbuf, "sign unplace %d file=%s", markId, filename);
+    vim_snprintf(cbuf, sizeof(cbuf),
+                                "sign unplace %d file=%s", markId, filename);
     coloncmd(cbuf, TRUE);
 }
 
@@ -633,7 +637,7 @@ workshop_menu_begin(
     mnembuf[idx++] = NUL;
     name = addUniqueMnemonic(mnembuf, label);
 
-    sprintf(curMenuName, "%s", name);
+    vim_snprintf(curMenuName, sizeof(curMenuName), "%s", name);
     sprintf(curMenuPriority, "%d.0", menuPriority);
 }
 
@@ -735,12 +739,12 @@ workshop_menu_item(
 #endif
 
     if (acceleratorText != NULL)
-       sprintf(accText, "<Tab>%s", acceleratorText);
+       vim_snprintf(accText, sizeof(accText), "<Tab>%s", acceleratorText);
     else
        accText[0] = NUL;
     updatePriority(False);
-    sprintf(namebuf, "%s.%s", curMenuName, fixup(label));
-    sprintf(cbuf, "amenu %s %s%s\t:wsverb %s<CR>",
+    vim_snprintf(namebuf, sizeof(namebuf), "%s.%s", curMenuName, fixup(label));
+    vim_snprintf(cbuf, sizeof(cbuf), "amenu %s %s%s\t:wsverb %s<CR>",
            curMenuPriority, namebuf, accText, verb);
 
     coloncmd(cbuf, TRUE);
@@ -748,7 +752,7 @@ workshop_menu_item(
 
     if (*sensitive == '0')
     {
-       sprintf(cbuf, "amenu disable %s", namebuf);
+       vim_snprintf(cbuf, sizeof(cbuf), "amenu disable %s", namebuf);
        coloncmd(cbuf, TRUE);
     }
 }
@@ -824,6 +828,7 @@ workshop_toolbar_button(
     char       namebuf[BUFSIZ];
     static int tbid = 1;
     char_u     *p;
+    int                len;
 
 #ifdef WSDEBUG_TRACE
     if (WSDLEVEL(WS_TRACE_VERBOSE))
@@ -858,16 +863,18 @@ workshop_toolbar_button(
     }
 
     p = vim_strsave_escaped((char_u *)label, (char_u *)"\\. ");
-    sprintf(namebuf, "ToolBar.%s", p);
+    vim_snprintf(namebuf, sizeof(namebuf), "ToolBar.%s", p);
     vim_free(p);
     STRCPY(cbuf, "amenu <silent> ");
     if (file != NULL && *file != NUL)
     {
        p = vim_strsave_escaped((char_u *)file, (char_u *)" ");
-       sprintf(cbuf + STRLEN(cbuf), "icon=%s ", p);
+       len = STRLEN(cbuf);
+       vim_snprintf(cbuf + len, sizeof(cbuf) - len, "icon=%s ", p);
        vim_free(p);
     }
-    sprintf(cbuf + STRLEN(cbuf), "1.%d %s :wsverb %s<CR>",
+    len = STRLEN(cbuf);
+    vim_snprintf(cbuf + len, sizeof(cbuf) - len,"1.%d %s :wsverb %s<CR>",
                                                        tbpri, namebuf, verb);
 
     /* Define the menu item */
@@ -876,14 +883,14 @@ workshop_toolbar_button(
     if (*sense == '0')
     {
        /* If menu isn't sensitive at startup... */
-       sprintf(cbuf, "amenu disable %s", namebuf);
+       vim_snprintf(cbuf, sizeof(cbuf), "amenu disable %s", namebuf);
        coloncmd(cbuf, True);
     }
 
     if (help && *help)
     {
        /* Do the tooltip */
-       sprintf(cbuf, "tmenu %s %s", namebuf, help);
+       vim_snprintf(cbuf, sizeof(cbuf), "tmenu %s %s", namebuf, help);
        coloncmd(cbuf, True);
     }
 
@@ -961,7 +968,7 @@ workshop_set_option(
     {
        case 's':
            if (strcmp(option, "syntax") == 0)
-               sprintf(cbuf, "syntax %s", value);
+               vim_snprintf(cbuf, sizeof(cbuf), "syntax %s", value);
            else if (strcmp(option, "savefiles") == 0)
                ; /* XXX - Not yet implemented */
            break;
@@ -1074,7 +1081,8 @@ workshop_hotkeys(
        {
            if (mp->accel != NULL)
            {
-               sprintf(cbuf, "map %s :wsverb %s<CR>", mp->accel, mp->verb);
+               vim_snprintf(cbuf, sizeof(cbuf),
+                       "map %s :wsverb %s<CR>", mp->accel, mp->verb);
                coloncmd(cbuf, TRUE);
            }
        }
@@ -1083,7 +1091,7 @@ workshop_hotkeys(
        {
            if (mp->accel != NULL)
            {
-               sprintf(cbuf, "unmap %s", mp->accel);
+               vim_snprintf(cbuf, sizeof(cbuf), "unmap %s", mp->accel);
                coloncmd(cbuf, TRUE);
            }
        }
@@ -1272,7 +1280,7 @@ load_buffer_by_name(
     else
        lnumbuf[0] = NUL;
 
-    sprintf(cbuf, "e %s %s", lnumbuf, filename);
+    vim_snprintf(cbuf, sizeof(cbuf), "e %s %s", lnumbuf, filename);
     coloncmd(cbuf, False);
 }
 
@@ -1392,9 +1400,11 @@ updatePriority(
     pri = atoi(p) + 10;                /* our new priority */
 
     if (subMenu)
-       sprintf(curMenuPriority, "%s.%d.0", curMenuPriority, pri);
+       vim_snprintf(curMenuPriority, sizeof(curMenuPriority),
+                                            "%s.%d.0", curMenuPriority, pri);
     else
-       sprintf(curMenuPriority, "%s.%d", curMenuPriority, pri);
+       vim_snprintf(curMenuPriority, sizeof(curMenuPriority),
+                                              "%s.%d", curMenuPriority, pri);
 }
 
     static char *
@@ -1543,7 +1553,7 @@ fixAccelText(
 
     if (*ap == 'F' && atoi(&ap[1]) > 0)
     {
-       sprintf(buf, "<%s%s>", shift, ap);
+       vim_snprintf(buf, sizeof(buf), "<%s%s>", shift, ap);
        return strdup(buf);
     }
     else
@@ -1607,7 +1617,7 @@ workshop_beval_cb(
                    type = (int)GPLineEval_EVALUATE;
 
                /* Send request to dbx */
-               sprintf(buf, "toolVerb debug.balloonEval "
+               vim_snprintf(buf, sizeof(buf), "toolVerb debug.balloonEval "
                        "%s %ld,0 %d,0 %d,%d %ld %s\n",
                        (char *)wp->w_buffer->b_ffname,
                        (long)lnum, idx, type, serialNo++,
@@ -1670,7 +1680,8 @@ addMenu(
        menuMap[menuMapSize++].verb = strdup(verb);
        if (accel && workshopHotKeysEnabled)
        {
-           sprintf(cbuf, "map %s :wsverb %s<CR>", accel, verb);
+           vim_snprintf(cbuf, sizeof(cbuf),
+                                       "map %s :wsverb %s<CR>", accel, verb);
            coloncmd(cbuf, TRUE);
        }
     }
index c3dba9931cf2a5dad6e34f121998196686118076..2707fae2052a133486f9460600da9c3b3ce118ce 100644 (file)
@@ -86,10 +86,11 @@ wsdebug_log_init(
        char            *file;          /* possible ws_debug output file */
        char            *cp;            /* ws_dlevel pointer */
 
-       if (log_var && (file = getenv(log_var)) != NULL) {
+       if (log_var && (file = getenv(log_var)) != NULL)
+       {
                char buf[BUFSIZ];
 
-               sprintf(buf, "date > %s", file);
+               vim_snprintf(buf, sizeof(buf), "date > %s", file);
                system(buf);
                ws_debug = fopen(file, "a");
                if (level_var && (cp = getenv(level_var)) != NULL) {