]> granicus.if.org Git - vim/commitdiff
patch 7.4.2229 v7.4.2229
authorBram Moolenaar <Bram@vim.org>
Sat, 20 Aug 2016 13:05:39 +0000 (15:05 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 20 Aug 2016 13:05:39 +0000 (15:05 +0200)
Problem:    Startup test fails on Solaris.
Solution:   Recognize a character device. (Danek Duvall)

src/buffer.c
src/fileio.c
src/proto/fileio.pro
src/version.c
src/vim.h

index 4f688825583a0e1bed4a0ee60f03adf5c5c6bbd7..184f09f354b7fa4e68dc66dbdd145bf6884e1e7e 100644 (file)
@@ -219,6 +219,9 @@ open_buffer(
 # endif
 # ifdef S_ISSOCK
                      || S_ISSOCK(perm)
+# endif
+# ifdef OPEN_CHR_FILES
+                     || (S_ISCHR(perm) && is_dev_fd_file(curbuf->b_ffname))
 # endif
                    ))
                read_fifo = TRUE;
index 3c3d54835d9b8636d2627f377f88c3be5e723cf1..5e53feef412f2d2385bb7193fb583fb5640a5524 100644 (file)
 /* Is there any system that doesn't have access()? */
 #define USE_MCH_ACCESS
 
-#if (defined(sun) || defined(__FreeBSD__)) && defined(S_ISCHR)
-# define OPEN_CHR_FILES
-static int is_dev_fd_file(char_u *fname);
-#endif
 #ifdef FEAT_MBYTE
 static char_u *next_fenc(char_u **pp);
 # ifdef FEAT_EVAL
@@ -2718,14 +2714,14 @@ failed:
     return OK;
 }
 
-#ifdef OPEN_CHR_FILES
+#if defined(OPEN_CHR_FILES) || defined(PROTO)
 /*
  * Returns TRUE if the file name argument is of the form "/dev/fd/\d\+",
  * which is the name of files used for process substitution output by
  * some shells on some operating systems, e.g., bash on SunOS.
  * Do not accept "/dev/fd/[012]", opening these may hang Vim.
  */
-    static int
+    int
 is_dev_fd_file(char_u *fname)
 {
     return (STRNCMP(fname, "/dev/fd/", 8) == 0
index 748bf4c9b11beb4d8f3134ef1345378607c919ee..30582d4e1413be54e58d6c673021a8f29f89b8b0 100644 (file)
@@ -1,6 +1,7 @@
 /* fileio.c */
 void filemess(buf_T *buf, char_u *name, char_u *s, int attr);
 int readfile(char_u *fname, char_u *sfname, linenr_T from, linenr_T lines_to_skip, linenr_T lines_to_read, exarg_T *eap, int flags);
+int is_dev_fd_file(char_u *fname);
 int prep_exarg(exarg_T *eap, buf_T *buf);
 void set_file_options(int set_options, exarg_T *eap);
 void set_forced_fenc(exarg_T *eap);
index 6486e6a67facae8db791aaaa75db563ca026e674..2f832706e430948cbdc14700db476eed99b8163e 100644 (file)
@@ -763,6 +763,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2229,
 /**/
     2228,
 /**/
index 88d4850efb9b0c258ce6714470b19905e6d65b02..898ebb60b83f15297c7959577f42230249b22e88 100644 (file)
--- a/src/vim.h
+++ b/src/vim.h
@@ -2485,4 +2485,8 @@ typedef enum
 #define FNE_INCL_BR    1       /* include [] in name */
 #define FNE_CHECK_START        2       /* check name starts with valid character */
 
+#if (defined(sun) || defined(__FreeBSD__)) && defined(S_ISCHR)
+# define OPEN_CHR_FILES
+#endif
+
 #endif /* VIM__H */