Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4700613

TTY: command line interpreter needs to handle backslash escapes

XMLWordPrintable

    • generic, sparc
    • generic, solaris_7



      Name: tb29552 Date: 06/11/2002

      /*
       * javac -g A.java
       * jdb A
       * stop at A:21
       * run
       * print i [ gives 'i = 6' as expected ]
       * print s.indexOf("g") [ gives 9, as expected ]
       * print s.indexOf("\"") [ gives -1, should be 6 ]
       * print s.indexOf("\\") [ gives -1, should be 15 ]
       *
       *
       */
      class A {
          public static void main(String[] args) {
              String s = "abcdef\"=\"ghijkl\\mnopqr";
              System.out.println(s);
              int i = s.indexOf("\"");
              int j = s.indexOf("\\");
              System.out.println("i is: " + i);
              System.out.println("j is: " + j);
              System.exit(0); // <---- Line 21
          }
      }

            Unassigned Unassigned
            tbell Tim Bell
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: