comparison 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
comparison
equal deleted inserted replaced
654:d7fe7b88e4fc 655:de6837908702
444 for (arg_elt = arglst; *arg_elt; arg_elt++) 444 for (arg_elt = arglst; *arg_elt; arg_elt++)
445 g_free(*arg_elt); 445 g_free(*arg_elt);
446 g_free(arglst); 446 g_free(arglst);
447 } 447 }
448 448
449 // replace_nl_with_dots(bufstr)
450 // Replace '\n' with "(...)" (or with a NUL if the string is too short)
451 void replace_nl_with_dots(char *bufstr)
452 {
453 char *p = strchr(bufstr, '\n');
454 if (p) {
455 if (strlen(p) >= 5)
456 strcpy(p, "(...)");
457 else
458 *p = 0;
459 }
460 }
461
449 /* vim: set expandtab cindent cinoptions=>2\:2(0: For Vim users... */ 462 /* vim: set expandtab cindent cinoptions=>2\:2(0: For Vim users... */