elvis (2.2.0-11.1) martin_dietze.patch

Summary

 tagelvis.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

    
download this patch

Patch contents

Hello,

 Elvis 2.2.0 has a bug causing it to exit 1 and not save any
files if started in a directory which contains a directory
"tags". This is fixed by the following patch:

========================================================================

Index: elvis-2.2.0/tagelvis.c
===================================================================
--- elvis-2.2.0.orig/tagelvis.c	2009-03-03 20:44:07.000000000 +0530
+++ elvis-2.2.0/tagelvis.c	2009-03-03 21:10:51.000000000 +0530
@@ -672,6 +672,7 @@
 	CHAR	*cp;		/* for scanning the line */
 	long	offset;		/* offset of the tag within this buffer */
 	int	i;
+        DIRPERM perm;
 
 	/* Destroy the old list, if any */
 	tefreedef(buf);
@@ -701,7 +702,8 @@
 	 * necessary because the ioopen() function displays an error
 	 * message when the file it's trying to read doesn't exist.
 	 */
-	if (dirperm("tags") == DIR_NEW)
+        perm = dirperm("tags");
+        if (perm == DIR_NEW || perm == DIR_DIRECTORY)
 		return;
 
 	/* open the file */