Changeset 2777 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2010-01-08T17:59:54+01:00 (15 years ago)
Author:
mjulius
Message:

fixes #2473 - Search does not work when searching for value containing literal quote
Quotes within quoted strings can now be escaped with backslash.

Location:
trunk/src/org/openstreetmap/josm/actions/search
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/search/PushbackTokenizer.java

    r2768 r2777  
    7373            getChar();
    7474            StringBuilder s = new StringBuilder();
    75             while (c != -1 && c != '"') {
    76                 s.append((char)c);
     75            boolean escape = false;
     76            while (c != -1 && (c != '"' || escape)) {
     77                if (c == '\\' && !escape) {
     78                    escape = true;
     79                } else {
     80                    s.append((char)c);
     81                    escape = false;
     82                }
    7783                getChar();
    7884            }
  • trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java

    r2695 r2777  
    138138                    + "<li>"+tr("<b>parent <i>expr</i></b> - all parents of objects matching the expression")+"</li>"
    139139                    + "<li>"+tr("Use <b>|</b> or <b>OR</b> to combine with logical or")+"</li>"
    140                     + "<li>"+tr("Use <b>\"</b> to quote operators (e.g. if key contains :)")+"</li>"
     140                    + "<li>"+tr("Use <b>\"</b> to quote operators (e.g. if key contains <b>:</b>)") + "<br/>"
     141                    + tr("Within quoted strings the <b>\"</b> and <b>\\</b> characters need to be escaped by a preceding <b>\\</b> (e.g. <b>\\\"</b> and <b>\\\\</b>).")+"</li>"
    141142                    + "<li>"+tr("Use <b>(</b> and <b>)</b> to group expressions")+"</li>"
    142143                    + "</ul></html>");
Note: See TracChangeset for help on using the changeset viewer.