Module Name:    src
Committed By:   christos
Date:           Sun Apr 18 21:17:47 UTC 2010

Modified Files:
        src/lib/libedit/TEST: tc1.c wtc1.c

Log Message:
\033 is more portable than \e still.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libedit/TEST/tc1.c
cvs rdiff -u -r1.1 -r1.2 src/lib/libedit/TEST/wtc1.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libedit/TEST/tc1.c
diff -u src/lib/libedit/TEST/tc1.c:1.4 src/lib/libedit/TEST/tc1.c:1.5
--- src/lib/libedit/TEST/tc1.c:1.4	Wed Apr 14 20:50:46 2010
+++ src/lib/libedit/TEST/tc1.c	Sun Apr 18 17:17:47 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: tc1.c,v 1.4 2010/04/15 00:50:46 christos Exp $	*/
+/*	$NetBSD: tc1.c,v 1.5 2010/04/18 21:17:47 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = "@(#)test.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: tc1.c,v 1.4 2010/04/15 00:50:46 christos Exp $");
+__RCSID("$NetBSD: tc1.c,v 1.5 2010/04/18 21:17:47 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -72,7 +72,7 @@
 static char *
 prompt(EditLine *el)
 {
-	static char a[] = "\1\e[7m\1Edit$\1\e[0m\1 ";
+	static char a[] = "\1\033[7m\1Edit$\1\033[0m\1 ";
 	static char b[] = "Edit> ";
 
 	return (continuation ? b : a);
@@ -92,6 +92,7 @@
 	const char* ptr;
 	const LineInfo *lf = el_line(el);
 	int len;
+	int res = CC_ERROR;
 
 	/*
 	 * Find the last word
@@ -105,16 +106,16 @@
 		if (len > strlen(dp->d_name))
 			continue;
 		if (strncmp(dp->d_name, ptr, len) == 0) {
-			closedir(dd);
 			if (el_insertstr(el, &dp->d_name[len]) == -1)
-				return (CC_ERROR);
+				res = CC_ERROR;
 			else
-				return (CC_REFRESH);
+				res = CC_REFRESH;
+			break;
 		}
 	}
 
 	closedir(dd);
-	return (CC_ERROR);
+	return res;
 }
 
 int

Index: src/lib/libedit/TEST/wtc1.c
diff -u src/lib/libedit/TEST/wtc1.c:1.1 src/lib/libedit/TEST/wtc1.c:1.2
--- src/lib/libedit/TEST/wtc1.c:1.1	Sun Jan  3 13:27:10 2010
+++ src/lib/libedit/TEST/wtc1.c	Sun Apr 18 17:17:47 2010
@@ -18,7 +18,7 @@
 static wchar_t *
 prompt(EditLine *el)
 {
-	static wchar_t a[] = L"\1\e[7m\1Edit$\1\e[0m\1 ";
+	static wchar_t a[] = L"\1\033[7m\1Edit$\1\033[0m\1 ";
 	static wchar_t b[] = L"Edit> ";
 
 	return continuation ? b : a;

Reply via email to