]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0690: Solaris: swap file names are too long v9.2.0690
authorVladimír Marek <vlmarek13@gmail.com>
Sun, 21 Jun 2026 14:58:30 +0000 (14:58 +0000)
committerChristian Brabandt <cb@256bit.org>
Sun, 21 Jun 2026 14:58:30 +0000 (14:58 +0000)
Problem:  Solaris: dirent.h exposes MAXNAMLEN as 512, but the usable
          file name component limit is 255 (defined in param.h).  Vim
          derives BASENAMELEN for generated swap file names from
          MAXNAMLEN, so it creates overlong components and fails to
          rename the swap file with ENAMETOOLONG (Vladimír Marek).
Solution: Override MAXNAMLEN to the effective Solaris component limit
          of 255 for swap file name generation.

closes: #20573

Signed-off-by: Vladimír Marek <vlmarek13@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/os_unix.h
src/version.c

index a507392277d0cb1f274c9b2c66d58d7768db2d35..476c9c21c3433d290eaa944a9809691d35674c25 100644 (file)
@@ -122,6 +122,11 @@ typedef void (*sighandler_T) SIGPROTOARG;
 # define MAXNAMLEN NAME_MAX        // for Linux before .99p3
 #endif
 
+#if defined(__sun)
+# undef MAXNAMLEN
+# define MAXNAMLEN 255
+#endif
+
 /*
  * Note: if MAXNAMLEN has the wrong value, you will get error messages
  *      for not being able to open the swap file.
index eb88baacac98f950898f44334ad8f0eacf5a8692..745f523abebeb46200a0a95002790fed7c0cf340 100644 (file)
@@ -759,6 +759,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    690,
 /**/
     689,
 /**/