Mercurial > vim
comparison src/list.c @ 9571:5eaa708ab50d v7.4.2063
commit https://github.com/vim/vim/commit/73dad1e64cb42842d8259cb1a255a6fa59822f76
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jul 17 22:13:49 2016 +0200
patch 7.4.2063
Problem: eval.c is still too big.
Solution: Split off internal functions to evalfunc.c.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 17 Jul 2016 22:30:06 +0200 |
parents | 1e68dfd7931b |
children | 172131507c85 |
comparison
equal
deleted
inserted
replaced
9570:695186e11daa | 9571:5eaa708ab50d |
---|---|
882 } | 882 } |
883 | 883 |
884 return OK; | 884 return OK; |
885 } | 885 } |
886 | 886 |
887 #endif /* defined(FEAT_MODIFY_FNAME) || defined(FEAT_EVAL) */ | 887 /* |
888 * Write list of strings to file | |
889 */ | |
890 int | |
891 write_list(FILE *fd, list_T *list, int binary) | |
892 { | |
893 listitem_T *li; | |
894 int c; | |
895 int ret = OK; | |
896 char_u *s; | |
897 | |
898 for (li = list->lv_first; li != NULL; li = li->li_next) | |
899 { | |
900 for (s = get_tv_string(&li->li_tv); *s != NUL; ++s) | |
901 { | |
902 if (*s == '\n') | |
903 c = putc(NUL, fd); | |
904 else | |
905 c = putc(*s, fd); | |
906 if (c == EOF) | |
907 { | |
908 ret = FAIL; | |
909 break; | |
910 } | |
911 } | |
912 if (!binary || li->li_next != NULL) | |
913 if (putc('\n', fd) == EOF) | |
914 { | |
915 ret = FAIL; | |
916 break; | |
917 } | |
918 if (ret == FAIL) | |
919 { | |
920 EMSG(_(e_write)); | |
921 break; | |
922 } | |
923 } | |
924 return ret; | |
925 } | |
926 | |
927 #endif /* defined(FEAT_EVAL) */ |