Skip to content

Fox name test starting with escaped space character does not work #5

@brandes-pq

Description

@brandes-pq

Trying to match a file the name of which starts with a space character with a fox name test does not match the file.

According to the documentation, whitespace in a fox name test must be escaped. There are two possible forms:

  • Canonical syntax: ` a`
  • Abbreviated syntax: ~ a

They both fail to match a file named ' a':

> ls ' a'
 a
> fox '~ a'

> fox '` a`'

If the space is not in leading position, everything works as expected (for illustration purposes, space characters in the result are represented by ⎵ ):

> ls 'a '
a⎵
> fox 'a~ '
/strange-names/a⎵
> fox '`a `'
/strange-names/a⎵

The generated regular expression looks fine in both cases.

> fox -p '~ a'
<foxpathTree>
  <foxpath context="/strange-names" text="~ a">
    <foxStep axis="child" name=" a" regex="^ a$"/>
  </foxpath>
</foxpathTree>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions