Search
lxdream.org :: lxdream/src/gdrom/gdimage.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/gdrom/gdimage.c
changeset 464:8e099fad42a6
prev422:61a0598e07ff
next468:3a49695e081a
author nkeynes
date Sat Oct 27 05:44:54 2007 +0000 (14 years ago)
permissions -rw-r--r--
last change Initial gdrom attachment menu
file annotate diff log raw
1.1 --- a/src/gdrom/gdimage.c Sat Oct 06 09:03:24 2007 +0000
1.2 +++ b/src/gdrom/gdimage.c Sat Oct 27 05:44:54 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: gdimage.c,v 1.2 2007-10-06 08:58:00 nkeynes Exp $
1.6 + * $Id: gdimage.c,v 1.3 2007-10-27 05:44:54 nkeynes Exp $
1.7 *
1.8 * GD-Rom image-file common functions.
1.9 *
1.10 @@ -47,7 +47,7 @@
1.11 disc->close = gdrom_image_destroy;
1.12 }
1.13
1.14 -gdrom_disc_t gdrom_image_new( FILE *f )
1.15 +gdrom_disc_t gdrom_image_new( const gchar *filename, FILE *f )
1.16 {
1.17 gdrom_image_t image = (gdrom_image_t)calloc(sizeof(struct gdrom_image), 1);
1.18 if( image == NULL ) {
1.19 @@ -55,9 +55,14 @@
1.20 }
1.21 image->disc_type = IDE_DISC_CDROM;
1.22 image->file = f;
1.23 -
1.24 gdrom_disc_t disc = (gdrom_disc_t)image;
1.25 gdrom_image_init(disc);
1.26 + if( filename == NULL ) {
1.27 + disc->name = NULL;
1.28 + } else {
1.29 + disc->name = g_strdup(filename);
1.30 + }
1.31 +
1.32 return disc;
1.33 }
1.34
1.35 @@ -68,6 +73,10 @@
1.36 fclose(img->file);
1.37 img->file = NULL;
1.38 }
1.39 + if( disc->name != NULL ) {
1.40 + g_free( disc->name );
1.41 + disc->name = NULL;
1.42 + }
1.43 free( disc );
1.44 }
1.45
.