This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 29875
Collapse All | Expand All

(-)ModuleUpdater.java (-3 / +24 lines)
Lines 364-365 Link Here
364
                            + "bin"  + FILE_SEPARATOR;                                       // NOI18N
364
                            + "bin"  + FILE_SEPARATOR + "java";                                       // NOI18N
365
                        String torun = java_path + "java -cp " + getMainDirString() + mconfig.getCommand();  // NOI18N
365
                        java_path = quoteString(java_path);
366
--
366
                        String torun = java_path + " -cp " + quoteString(getMainDirString()) + mconfig.getCommand();  // NOI18N
Line 648 Link Here
649
    
650
    /** Quotes string correctly, eg. removes all quotes from the string and adds 
651
     * just one at the start and
652
     * second one at the end.
653
     * @param s string to be quoted
654
     * @return correctly quoted string
655
     */
656
    public static final String quoteString(String s) {
657
        if (s.indexOf(' ') > -1) {
658
            StringBuffer sb = new StringBuffer(s);
659
            int i = 0;
660
            while (i < sb.length()) {
661
                if (sb.charAt(i) == '\"') sb.deleteCharAt(i);
662
                else i++;
663
            }
664
            sb.insert(0, '\"');
665
            sb.append('\"');
666
            return sb.toString();
667
        }
668
        return s;
669
    }    

Return to bug 29875