[PATCH 2/3] kconfig: kxgettext: EOL fix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The end of line character doesn't exist on end of help in all case,
check it first.

Signed-off-by: Egry Gabor <[email protected]>

---

 kxgettext.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletion(-)

diff -Nru linux-2.6.13-rc2/scripts/kconfig/kxgettext.c
linux-2.6.13-rc2-i18n-kconfig/scripts/kconfig/kxgettext.c
--- linux-2.6.13-rc2/scripts/kconfig/kxgettext.c	2005-07-09
12:16:04.000000000 +0200
+++ linux-2.6.13-rc2-i18n-kconfig/scripts/kconfig/kxgettext.c	2005-07-09
13:38:48.000000000 +0200
@@ -14,6 +14,11 @@
 {
 	char *bfp = bf;
 	int multiline = strchr(text, '\n') != NULL;
+	int eol = 0;
+	int textlen = strlen(text);
+
+	if ((textlen > 0) && (text[textlen-1] == '\n'))
+		eol = 1;
 
 	*bfp++ = '"';
 	--len;
@@ -43,7 +48,7 @@
 		--len;
 	}
 
-	if (multiline)
+	if (multiline && eol)
 		bfp -= 3;
 
 	*bfp++ = '"';


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux