File ed-0.2-strip-escapes.patch of Package ed

Index: ed-0.2/main.c
===================================================================
--- ed-0.2.orig/main.c
+++ ed-0.2/main.c
@@ -1636,17 +1636,18 @@ has_trailing_escape (s, t)
 }
 
 
-/* strip_escapes: return copy of escaped string of at most length PATH_MAX */
+/* return unescaped copy of escaped string */
 char *
 strip_escapes (s)
      char *s;
 {
   static char *file = NULL;
   static int filesz = 0;
+  const int len = strlen( s );
 
   int i = 0;
 
-  REALLOC (file, filesz, PATH_MAX + 1, NULL);
+  REALLOC (file, filesz, len + 1, NULL);
   /* assert: no trailing escape */
   while (file[i++] = (*s == '\\') ? *++s : *s)
     s++;
openSUSE Build Service is sponsored by