Changeset 24358


Ignore:
Timestamp:
2011-08-01T15:37:22+12:00 (12 years ago)
Author:
ak19
Message:

Improvement to previous commit (also process first command parameter, the actual program being launched): Now can put the %1 in file associations menu inside single or double quotes (John Rose found that this was not working previously).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/Gatherer.java

    r24357 r24358  
    14171417                if(commands != null) {
    14181418                    StringBuffer whole_command = new StringBuffer();
    1419                     for(int i = 0; i < commands.length; i++) {
     1419                    for(int i = 0; i < commands.length; i++) {                     
     1420                        // get rid of any quotes around parameters in file associations
     1421                        if(commands[i].startsWith("\"") || commands[i].startsWith("\'")) {
     1422                            commands[i] = commands[i].substring(1);
     1423                        }
     1424                        if(commands[i].endsWith("\"") || commands[i].endsWith("\'")) {
     1425                            commands[i] = commands[i].substring(0, commands[i].length()-1);
     1426                        }
     1427
    14201428                        if (i>0) {
    1421                             // get rid of any quotes around parameters in file associations
    1422                             if(commands[i].startsWith("\"") || commands[i].startsWith("\'")) {
    1423                             commands[i] = commands[i].substring(1);
    1424                             }
    1425                             if(commands[i].endsWith("\"") || commands[i].endsWith("\'")) {
    1426                             commands[i] = commands[i].substring(0, commands[i].length()-1);
    1427                             }                           
    14281429                            whole_command.append(" ");
    14291430                        }
    1430                         whole_command.append(commands[i]);
     1431                        whole_command.append(commands[i]);         
    14311432                    }
    14321433                    DebugStream.println("Running " + whole_command.toString());
Note: See TracChangeset for help on using the changeset viewer.