diff mcabber/src/utils.c @ 655:de6837908702

Use "(...)" when cutting a multi-line status message in the log window Thanks to Salvador for suggesting...
author Mikael Berthe <mikael@lilotux.net>
date Sat, 07 Jan 2006 13:59:17 +0100
parents fed6d1e4d7a9
children ee03b56b93ee
line wrap: on
line diff
--- a/mcabber/src/utils.c	Sat Jan 07 12:17:49 2006 +0100
+++ b/mcabber/src/utils.c	Sat Jan 07 13:59:17 2006 +0100
@@ -446,4 +446,17 @@
   g_free(arglst);
 }
 
+//  replace_nl_with_dots(bufstr)
+// Replace '\n' with "(...)" (or with a NUL if the string is too short)
+void replace_nl_with_dots(char *bufstr)
+{
+  char *p = strchr(bufstr, '\n');
+  if (p) {
+    if (strlen(p) >= 5)
+      strcpy(p, "(...)");
+    else
+      *p = 0;
+  }
+}
+
 /* vim: set expandtab cindent cinoptions=>2\:2(0:  For Vim users... */