Module Name: src Committed By: christos Date: Tue Jan 12 19:37:18 UTC 2010
Modified Files: src/lib/libedit: chartype.c Log Message: - in the argv conversion, handle NULL as NULL - when printing tab/nl print them, don't handle them specially. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/lib/libedit/chartype.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/chartype.c diff -u src/lib/libedit/chartype.c:1.2 src/lib/libedit/chartype.c:1.3 --- src/lib/libedit/chartype.c:1.2 Thu Dec 31 13:32:37 2009 +++ src/lib/libedit/chartype.c Tue Jan 12 14:37:18 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: chartype.c,v 1.2 2009/12/31 18:32:37 christos Exp $ */ +/* $NetBSD: chartype.c,v 1.3 2010/01/12 19:37:18 christos Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include "config.h" #if !defined(lint) && !defined(SCCSID) -__RCSID("$NetBSD: chartype.c,v 1.2 2009/12/31 18:32:37 christos Exp $"); +__RCSID("$NetBSD: chartype.c,v 1.3 2010/01/12 19:37:18 christos Exp $"); #endif /* not lint && not SCCSID */ #include "el.h" #include <stdlib.h> @@ -159,7 +159,7 @@ for (i = 0, p = conv->wbuff; i < argc; ++i) { if (!argv[i]) { /* don't pass null pointers to mbstowcs */ wargv[i] = NULL; - bytes = -1; + continue; } else { wargv[i] = p; bytes = mbstowcs(p, argv[i], bufspace); @@ -295,6 +295,8 @@ { int t = ct_chr_class(c); switch (t) { + case CHTYPE_TAB: + case CHTYPE_NL: case CHTYPE_ASCIICTL: if (len < 2) return -1; /* insufficient space */ @@ -335,8 +337,6 @@ #endif /*FALLTHROUGH*/ /* these two should be handled outside this function */ - case CHTYPE_TAB: - case CHTYPE_NL: default: /* we should never hit the default */ return 0; }