char anotherbuffer [ FILENAME_MAX ];
strcpy ( anotherbuffer, pFilename );
char *s = strstr ( anotherbuffer, PXML_FILENAME );
- strcpy ( s, strdup(pElem->GetText()));
- app->icon = strdup(anotherbuffer);
+ if ( s ) {
+ strcpy ( s, strdup(pElem->GetText()));
+ app->icon = strdup(anotherbuffer);
+ }
}
pElem = hRoot.FirstChild( "description" ).FirstChildElement("en").Element();
char anotherbuffer [ FILENAME_MAX ];
strcpy ( anotherbuffer, pFilename );
char *s = strstr ( anotherbuffer, PXML_FILENAME );
- strcpy ( s, strdup(pElem->GetText()));
- app->exec = strdup(anotherbuffer);
+ if ( s ) {
+ strcpy ( s, strdup(pElem->GetText()));
+ app->exec = strdup(anotherbuffer);
+ } else if ( ( s = strrchr ( anotherbuffer, '/' ) ) ) {
+ s += 1;
+ strcpy ( s, strdup(pElem->GetText()));
+ app->exec = strdup(anotherbuffer);
+ }
}
pElem = hRoot.FirstChild( "category" ).FirstChildElement("main").Element();