summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c
index 907b04c5..2b3e8dc1 100644
--- a/src/util.c
+++ b/src/util.c
@@ -59,6 +59,25 @@ zenity_util_load_glade_file (const gchar *widget_root)
return xml;
}
+gchar*
+zenity_util_strip_newline (gchar *string)
+{
+ gsize len;
+
+ g_return_val_if_fail (string != NULL, NULL);
+
+ len = strlen (string);
+ while (len--)
+ {
+ if (string[len] == '\n')
+ string[len] = '\0';
+ else
+ break;
+ }
+
+ return string;
+}
+
gboolean
zenity_util_fill_file_buffer (GtkTextBuffer *buffer, const gchar *filename)
{
bgstack15