Remove OOM checks: save_typebuf()

This commit is contained in:
Felipe Oliveira Carvalho 2014-05-10 01:11:34 -03:00
parent 39a272c4db
commit a2f6a53b68
3 changed files with 4 additions and 7 deletions

View File

@ -1177,12 +1177,11 @@ void free_typebuf(void)
*/ */
static typebuf_T saved_typebuf[NSCRIPT]; static typebuf_T saved_typebuf[NSCRIPT];
int save_typebuf(void) void save_typebuf(void)
{ {
init_typebuf(); init_typebuf();
saved_typebuf[curscript] = typebuf; saved_typebuf[curscript] = typebuf;
alloc_typebuf(); alloc_typebuf();
return OK;
} }
static int old_char = -1; /* character put back by vungetc() */ static int old_char = -1; /* character put back by vungetc() */
@ -1262,8 +1261,7 @@ openscript (
--curscript; --curscript;
return; return;
} }
if (save_typebuf() == FAIL) save_typebuf();
return;
/* /*
* Execute the commands from the file right now when using ":source!" * Execute the commands from the file right now when using ":source!"

View File

@ -33,7 +33,7 @@ int typebuf_maplen(void);
void del_typebuf(int len, int offset); void del_typebuf(int len, int offset);
void alloc_typebuf(void); void alloc_typebuf(void);
void free_typebuf(void); void free_typebuf(void);
int save_typebuf(void); void save_typebuf(void);
void save_typeahead(tasave_T *tp); void save_typeahead(tasave_T *tp);
void restore_typeahead(tasave_T *tp); void restore_typeahead(tasave_T *tp);
void openscript(char_u *name, int directly); void openscript(char_u *name, int directly);

View File

@ -1365,8 +1365,7 @@ scripterror:
mch_errmsg("\"\n"); mch_errmsg("\"\n");
mch_exit(2); mch_exit(2);
} }
if (save_typebuf() == FAIL) save_typebuf();
mch_exit(2); /* out of memory */
break; break;
case 't': /* "-t {tag}" */ case 't': /* "-t {tag}" */