src/jdk.internal.le/share/classes/jdk/internal/org/jline/utils/InfoCmp.java
changeset 58903 eeb1c0da2126
parent 52938 5ff7480c9e28
equal deleted inserted replaced
58902:197238c30630 58903:eeb1c0da2126
     1 /*
     1 /*
     2  * Copyright (c) 2002-2016, the original author or authors.
     2  * Copyright (c) 2002-2019, the original author or authors.
     3  *
     3  *
     4  * This software is distributable under the BSD license. See the terms of the
     4  * This software is distributable under the BSD license. See the terms of the
     5  * BSD license in the documentation provided with this software.
     5  * BSD license in the documentation provided with this software.
     6  *
     6  *
     7  * http://www.opensource.org/licenses/bsd-license.php
     7  * https://opensource.org/licenses/BSD-3-Clause
     8  */
     8  */
     9 package jdk.internal.org.jline.utils;
     9 package jdk.internal.org.jline.utils;
    10 
    10 
    11 import java.io.BufferedReader;
    11 import java.io.BufferedReader;
    12 import java.io.IOError;
    12 import java.io.IOError;
   576                     String key = cap.substring(0, index);
   576                     String key = cap.substring(0, index);
   577                     String val = cap.substring(index + 1);
   577                     String val = cap.substring(index + 1);
   578                     int iVal;
   578                     int iVal;
   579                     if (val.startsWith("0x")) {
   579                     if (val.startsWith("0x")) {
   580                         iVal = Integer.parseInt(val.substring(2), 16);
   580                         iVal = Integer.parseInt(val.substring(2), 16);
       
   581                     } else if (val.startsWith("0")) {
       
   582                         iVal = Integer.parseInt(val.substring(1), 8);
   581                     } else {
   583                     } else {
   582                         iVal = Integer.parseInt(val);
   584                         iVal = Integer.parseInt(val);
   583                     }
   585                     }
   584                     Capability c = capsByName.get(key);
   586                     Capability c = capsByName.get(key);
   585                     if (c != null) {
   587                     if (c != null) {
   612         }
   614         }
   613     }
   615     }
   614 
   616 
   615     static {
   617     static {
   616         for (String s : Arrays.asList("dumb", "ansi", "xterm", "xterm-256color",
   618         for (String s : Arrays.asList("dumb", "ansi", "xterm", "xterm-256color",
   617                                       "windows", "windows-256color", "windows-vtp",
   619                                       "windows", "windows-256color", "windows-conemu", "windows-vtp",
   618                                       "screen", "screen-256color")) {
   620                                       "screen", "screen-256color")) {
   619             setDefaultInfoCmp(s, () -> loadDefaultInfoCmp(s));
   621             setDefaultInfoCmp(s, () -> loadDefaultInfoCmp(s));
   620         }
   622         }
   621     }
   623     }
   622 
   624