Ignore:
Timestamp:
01/01/17 14:17:04 (6 years ago)
Author:
gost
Message:

test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • titan/plugins/tithek/tithek_global.h

    r39567 r39576  
    786786                drawscreen(load, 0, 0);
    787787
    788                 char* titheklocalfile = ostrcat("/tmp/tithek/mainmenu.local.list", NULL, 0, 0);
    789 
    790788                if(flag == 1)
    791789                {
     
    830828                        system(cmd);
    831829                        free(cmd), cmd = NULL;
    832 //                      }
    833        
    834                         cmd = ostrcat("ls -1 ", path, 0, 0);
    835                         cmd = ostrcat(cmd, "/*.sh", 1, 0);
    836        
    837                         free(path), path = NULL;
    838                         tmpstr1 = command("ls -1 /mnt/parser/*.sh");
    839                         tmpstr2 = command(cmd);
    840                         free(cmd), cmd = NULL;
    841                         tmpstr = ostrcat(tmpstr1, "\n", 0, 0);
    842                         tmpstr = ostrcat(tmpstr, tmpstr2, 1, 0);
    843        
    844                         int count = 0, i = 0;
    845                         struct splitstr* ret1 = NULL;
    846                         ret1 = strsplit(tmpstr, "\n", &count);
    847                
    848                         int max = count;
    849                         for(i = 0; i < max; i++)
     830                }
     831
     832                cmd = ostrcat("ls -1 ", path, 0, 0);
     833                cmd = ostrcat(cmd, "/*.sh", 1, 0);
     834
     835                free(path), path = NULL;
     836                tmpstr1 = command("ls -1 /mnt/parser/*.sh");
     837                tmpstr2 = command(cmd);
     838                free(cmd), cmd = NULL;
     839                tmpstr = ostrcat(tmpstr1, "\n", 0, 0);
     840                tmpstr = ostrcat(tmpstr, tmpstr2, 1, 0);
     841
     842                int count = 0, i = 0;
     843                struct splitstr* ret1 = NULL;
     844                ret1 = strsplit(tmpstr, "\n", &count);
     845       
     846                int max = count;
     847                for(i = 0; i < max; i++)
     848                {
     849                        if(file_exist(ret1[i].part) && cmpfilenameext(ret1[i].part, ".sh") == 0)
    850850                        {
    851                                 if(file_exist(ret1[i].part) && cmpfilenameext(ret1[i].part, ".sh") == 0)
    852                                 {
    853                                         cmd = ostrcat(ret1[i].part, " ", 0, 0);
    854                                         cmd = ostrcat(cmd, ret1[i].part, 1, 0);
    855                                         cmd = ostrcat(cmd, " init", 1, 0);
    856                                         line = command(cmd);
    857                                         debug(99, "add main menuentry: %s", line);
    858                                         writesys(titheklocalfile, line, 3);
    859                                         free(cmd), cmd = NULL;
    860                                         free(line), line = NULL;
    861                                 }
     851                                cmd = ostrcat(ret1[i].part, " ", 0, 0);
     852                                cmd = ostrcat(cmd, ret1[i].part, 1, 0);
     853                                cmd = ostrcat(cmd, " init", 1, 0);
     854                                line = command(cmd);
     855                                debug(99, "add main menuentry: %s", line);
     856                                writesys(tithekfile, line, 3);
     857                                free(cmd), cmd = NULL;
     858                                free(line), line = NULL;
    862859                        }
    863                         free(ret1), ret1 = NULL;
    864                         free(tmpstr), tmpstr = NULL;
    865                         free(tmpstr1), tmpstr1 = NULL;
    866                         free(tmpstr2), tmpstr2 = NULL;
    867                 }
    868 
    869                 line = readfiletomem(titheklocalfile, 1);
    870                 free(titheklocalfile), titheklocalfile = NULL;
    871                 writesys(tithekfile, line, 3);
    872 
     860                }
     861                free(ret1), ret1 = NULL;
     862                free(tmpstr), tmpstr = NULL;
     863                free(tmpstr1), tmpstr1 = NULL;
     864                free(tmpstr2), tmpstr2 = NULL;
    873865                clearscreen(load);
    874866        }
    875 
    876867}
    877868
Note: See TracChangeset for help on using the changeset viewer.