[Goodies-commits] r4138 - in xfbib/trunk: . src

Jesper Karlsson zarper at xfce.org
Sun Mar 30 13:30:19 CEST 2008


Author: zarper
Date: 2008-03-30 11:30:19 +0000 (Sun, 30 Mar 2008)
New Revision: 4138

Modified:
   xfbib/trunk/TODO
   xfbib/trunk/src/open.c
Log:
Xfbib: fixed a small issue with the filename of the opened file being corrupted.
Updated TODO.

Modified: xfbib/trunk/TODO
===================================================================
--- xfbib/trunk/TODO	2008-03-30 09:01:41 UTC (rev 4137)
+++ xfbib/trunk/TODO	2008-03-30 11:30:19 UTC (rev 4138)
@@ -9,3 +9,7 @@
 - Preamble and comment support.
 
 - Source view.
+
+- Non volatile configuration.
+
+- Option to att file extension on saving.
\ No newline at end of file

Modified: xfbib/trunk/src/open.c
===================================================================
--- xfbib/trunk/src/open.c	2008-03-30 09:01:41 UTC (rev 4137)
+++ xfbib/trunk/src/open.c	2008-03-30 11:30:19 UTC (rev 4138)
@@ -29,12 +29,16 @@
 
 int open_file (char *filename, struct xfbib *xfbib)
 {
+	char *opened;
+	
 	xfbib->filename = filename;
 	parse_file(xfbib);
 	update_treeview(xfbib);
 	_DEBUG(("Opening: %s", xfbib->filename));
 	gtk_window_set_title(GTK_WINDOW(xfbib->window.window), create_title(xfbib));
-	filename = (char *) realloc(filename, sizeof(char)*(strlen(filename) + strlen(" loaded...") + 1));
-	statusbar_push((GtkStatusbar *) xfbib->window.statusbar, 0, strcat(filename, _(" loaded...")));
+	opened = (char *) malloc(sizeof(char)*(strlen(filename) + strlen(" loaded...") + 1));
+	strcpy(opened, filename);
+	strcat(opened, _(" loaded..."));
+	statusbar_push((GtkStatusbar *) xfbib->window.statusbar, 0, opened);
 	return 0;
 }




More information about the Goodies-commits mailing list