Mercurial > pidgin
comparison console/libgnt/gntutils.c @ 14424:c374f45f4c94
[gaim-migrate @ 17132]
Do the same for the texts in buttons, and minor adjustments.
committer: Tailor Script <tailor@pidgin.im>
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Sat, 02 Sep 2006 23:23:30 +0000 |
parents | cfd5bcc06a7e |
children | ca36763497d9 |
comparison
equal
deleted
inserted
replaced
14423:cfd5bcc06a7e | 14424:c374f45f4c94 |
---|---|
80 str = g_string_new(NULL); | 80 str = g_string_new(NULL); |
81 | 81 |
82 while (*start) { | 82 while (*start) { |
83 if ((end = strchr(start, '\n')) != NULL || | 83 if ((end = strchr(start, '\n')) != NULL || |
84 (end = strchr(start, '\r')) != NULL) { | 84 (end = strchr(start, '\r')) != NULL) { |
85 if (gnt_util_onscreen_width(start, end) <= maxw) { | 85 if (gnt_util_onscreen_width(start, end) > maxw) |
86 ++end; | |
87 } else | |
88 end = NULL; | 86 end = NULL; |
89 } | 87 } |
90 if (end == NULL) | 88 if (end == NULL) |
91 end = gnt_util_onscreen_width_to_pointer(start, maxw, NULL); | 89 end = gnt_util_onscreen_width_to_pointer(start, maxw, NULL); |
92 str = g_string_append_len(str, start, end - start); | 90 str = g_string_append_len(str, start, end - start); |
91 if (*end) { | |
92 str = g_string_append_c(str, '\n'); | |
93 if (*end == '\n' || *end == '\r') | |
94 end++; | |
95 } | |
93 start = end; | 96 start = end; |
94 if (*end && *end != '\n' && *end != '\r') | |
95 str = g_string_append_c(str, '\n'); | |
96 } | 97 } |
97 return g_string_free(str, FALSE); | 98 return g_string_free(str, FALSE); |
98 } | 99 } |
99 | 100 |