get rid of EOL spaces
[pandora-libraries.git] / minimenu / mmcat.c
index a8c40a6..9600d33 100644 (file)
@@ -424,7 +424,7 @@ unsigned char category_meta_push ( char *catname, char *parentcatname, pnd_disco
   if ( parentcatname ) {
     if ( ( ! fdcat -> parent_cat ) ||
         ( ! fdpcat ) )
-    { 
+    {
       // child cat points to a different parent than requested parent!
       cat_is_clean = 0;
       pnd_log ( pndn_warning, "PXML Fail %s: Cat request %s (parent %s) -> cat wants to be child of a cat which FD says is the wrong parent (1)\n", app -> title_en ? app -> title_en : "no name?", catname, parentcatname ? parentcatname : "n/a" );
@@ -539,7 +539,10 @@ unsigned char category_meta_push ( char *catname, char *parentcatname, pnd_disco
   // so, is the cat we're looking at right now the apps main (or main alt) cat?
   if ( parentp ) {
     // and does this app have sub/altsub cats?
-    if ( app -> main_category1 || app -> main_category2 || app -> alt_category1 || app -> alt_category2 ) {
+    if ( ( parentp == 1 && ( app -> main_category1 || app -> main_category2 ) ) ||
+        ( parentp == 2 && ( app -> alt_category1 || app -> alt_category2 ) )
+       )
+    {
       // and we're only desiring the subcat version of the app?
       if ( pnd_conf_get_as_int_d ( g_conf, "tabs.subcat_to_parent", 1 ) == 0 ) {
        // create the parent category, since we need to be able to place a folder here maybe
@@ -785,6 +788,7 @@ void category_publish ( unsigned int filter_mask, char *param ) {
     } else if ( filter_mask == CFBYNAME ) {
       char *foo = strchr ( param, '*' ) + 1;
       if ( strncasecmp ( iter -> catname, param, strlen ( iter -> catname ) ) == 0 &&
+          iter -> parent_catname &&
           strcasecmp ( iter -> parent_catname, foo ) == 0 )
       {
        interested = 1;
@@ -849,15 +853,15 @@ unsigned int category_count ( unsigned int filter_mask ) {
 
 int category_index ( char *catname ) {
   unsigned char i;
+
   for ( i = 0; i < g_categorycount; i++ ) {
+
     if ( strcasecmp ( g_categories [ i ] -> catname, catname ) == 0 ) {
       return ( i );
     }
+
   }
+
   return ( -1 );
 }