#940659 starts editing in wrong line

Package:
ldapvi
Source:
ldapvi
Description:
perform an LDAP search and update results using a text editor
Submitter:
Juan Cespedes
Date:
2019-09-18 16:27:04 UTC
Severity:
normal
#940659#5
Date:
2019-09-18 16:25:14 UTC
From:
To:
When using "ldapvi" without SASL, ldapvi starts editing the LDAP results
at an undefined line number instead of just below the initial comments.

This patch fixes it:
--- ldapvi-1.7.orig/ldapvi.c
+++ ldapvi-1.7/ldapvi.c
@@ -1465,7 +1465,7 @@ copy_sasl_output(FILE *out, char *sasl)
 	int line = 0;
 	int c;

-	if (lstat(sasl, &st) == -1) return;
+	if (lstat(sasl, &st) == -1) return line;
 	if ( !(in = fopen(sasl, "r"))) syserr();

 	if (st.st_size > 0) {