Enlightenment CVS committal
Author : tsauerbeck
Project : e17
Module : libs/edje
Dir : e17/libs/edje/src/bin
Modified Files:
edje_cc_out.c
Log Message:
don't segfault on a missing default description
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edje/src/bin/edje_cc_out.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- edje_cc_out.c 23 Jan 2004 02:13:35 -0000 1.9
+++ edje_cc_out.c 6 Mar 2004 10:21:15 -0000 1.10
@@ -44,6 +44,11 @@
static Evas_List *program_lookups = NULL;
static Evas_List *image_lookups = NULL;
+#define ABORT_WRITE(eet_file, file) \
+ eet_close(eet_file); \
+ unlink(file); \
+ exit(-1);
+
void
data_setup(void)
{
@@ -94,7 +99,7 @@
{
fprintf(stderr, "%s: Error. unable to write \"edje_file\" entry to \"%s\"
\n",
progname, file_out);
- exit(-1);
+ ABORT_WRITE(ef, file_out);
}
else
total_bytes += bytes;
@@ -128,7 +133,7 @@
{
fprintf(stderr, "%s: Error. unable to read all of font file
\"%s\"\n",
progname, fn->file);
- exit(-1);
+ ABORT_WRITE(ef, file_out);
}
fsize = pos;
}
@@ -157,7 +162,7 @@
{
fprintf(stderr, "%s: Error. unable to read all of
font file \"%s\"\n",
progname, buf);
- exit(-1);
+ ABORT_WRITE(ef, file_out);
}
fsize = pos;
}
@@ -170,7 +175,7 @@
{
fprintf(stderr, "%s: Error. unable to write font part \"%s\" entry to %s
\n",
progname, fn->file, file_out);
- exit(-1);
+ ABORT_WRITE(ef, file_out);
}
else
{
@@ -182,7 +187,7 @@
{
fprintf(stderr, "%s: Error. unable to write font part \"%s\" as
\"%s\" part entry to %s \n",
progname, fn->file, buf, file_out);
- exit(-1);
+ ABORT_WRITE(ef, file_out);
}
else
{
@@ -254,7 +259,7 @@
{
fprintf(stderr, "%s: Error. unable to write image
part \"%s\" as \"%s\" part entry to %s \n",
progname, img->entry, buf, file_out);
- exit(-1);
+ ABORT_WRITE(ef, file_out);
}
else
{
@@ -266,7 +271,7 @@
{
fprintf(stderr, "%s: Error. unable to write image part
\"%s\" as \"%s\" part entry to %s \n",
progname, img->entry, buf, file_out);
- exit(-1);
+ ABORT_WRITE(ef, file_out);
}
if (verbose)
{
@@ -307,6 +312,14 @@
ep = ll->data;
epd = ep->default_desc;
+
+ if (!epd)
+ {
+ fprintf(stderr, "%s: Error. description missing for part \"%s\"\n",
+ progname, ep->name);
+ ABORT_WRITE(ef, file_out);
+ }
+
if (epd->text.font)
{
Evas_List *lll;
@@ -368,7 +381,7 @@
{
fprintf(stderr, "%s: Error. unable to write \"%s\" part entry to %s \n",
progname, buf, file_out);
- exit(-1);
+ ABORT_WRITE(ef, file_out);
}
else
{
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs