ecere/gui/Window: Fixed lock-up closing code editor while Finding in Files on Unix
[sdk] / ear / cmd / emear.ec
1 import "ecere"
2
3 class EarApp : Application
4 {
5    void Main()
6    {
7       if(argc > 2)
8       {
9          const String s = argv[2];
10          if(SearchString(s, 0, ".html", false, true))
11          {
12             char f[MAX_LOCATION];
13             char command[16384];
14             int i;
15             // ChangeExtension(s, "earres", f);
16             StripLastDirectory(s, f);
17             PathCat(f, "resources.ear");
18
19             sprintf(command, "ear aw %s", f);
20             for(i = 3; i < argc; i++)
21             {
22                bool quote = false;
23                strcat(command, " ");
24                if(!argv[i][0] || strchr(argv[i], ' '))
25                   quote = true;
26                if(quote) strcat(command, "\"");
27                strcat(command, argv[i]);
28                if(quote) strcat(command, "\"");
29             }
30             {
31                DualPipe p = DualPipeOpen(0, command);
32                p.Wait();
33             }
34          }
35       }
36    }
37 }