Index: xdgmimemagic.c =================================================================== RCS file: /cvs/gnome/gnome-vfs/libgnomevfs/xdgmimemagic.c,v retrieving revision 1.5 diff -u -r1.5 xdgmimemagic.c --- xdgmimemagic.c 21 Jan 2004 14:32:38 -0000 1.5 +++ xdgmimemagic.c 2 Mar 2004 20:08:32 -0000 @@ -495,11 +495,18 @@ } #endif } - - matchlet->next = match->matchlet; - match->matchlet = matchlet; - - + { + XdgMimeMagicMatchlet *m = match->matchlet; + if (m) { + while (m->next != NULL) { + m = m->next; + } + m->next = matchlet; + } else { + match->matchlet = matchlet; + } + } + return XDG_MIME_MAGIC_MAGIC; }