comparison src/misc1.c @ 5271:25f67b62afd8 v7.4b.012

updated for version 7.4b.012 Problem: Output from a shell command is truncated at a NUL. (lcd 47) Solution: Change every NUL into an SOH.
author Bram Moolenaar <bram@vim.org>
date Sat, 03 Aug 2013 14:10:50 +0200
parents 93cccad6a26b
children 3ddec3d25bd1
comparison
equal deleted inserted replaced
5270:f12b613858a6 5271:25f67b62afd8
10885 EMSG2(_(e_notread), tempname); 10885 EMSG2(_(e_notread), tempname);
10886 vim_free(buffer); 10886 vim_free(buffer);
10887 buffer = NULL; 10887 buffer = NULL;
10888 } 10888 }
10889 else 10889 else
10890 {
10891 /* Change NUL into SOH, otherwise the string is truncated. */
10892 for (i = 0; i < len; ++i)
10893 if (buffer[len] == NUL)
10894 buffer[len] = 1;
10895
10890 buffer[len] = NUL; /* make sure the buffer is terminated */ 10896 buffer[len] = NUL; /* make sure the buffer is terminated */
10897 }
10891 10898
10892 done: 10899 done:
10893 vim_free(tempname); 10900 vim_free(tempname);
10894 return buffer; 10901 return buffer;
10895 } 10902 }