Redirect bug?

#1
New one. Tried this:

> `"àsdf%23%39.pdf"`

got this:

TCC: (Sys) The system cannot find the file specified.
""

However, this worked:

> adsfas
ren adsfas `"àsdf%23%39.pdf"`

as:

E:\temp\down\adsfas -> E:\temp\down\àsdf%23%39.pdf
1 file renamed
 

rconn

Administrator
Staff member
May 14, 2008
10,580
97
#3
This isn't a bug, it's the way the TCC parser works. It could be changed, but there would be a significant amount of parser rewriting involved (and an as-yet-unknown number of new compatibility issues that would arise).

Redirection occurs before back quotes are processed and removed. (Back quotes are removed after the command name and type (internal or external) is parsed and just before control is passed to the command.) So TCC is looking for the output file name for the redirection, and scans everything up to the first invalid filename character (which in this case is immediate, as the first character is the backquote). So you wind up with an empty filename, and TCC complains.

I'll look and see if it's possible to add a simple hack to check to see if a redirected filename begins with a ` and strip it then.
 
#5
I'll look and see if it's possible to add a simple hack to check to see if a redirected filename begins with a ` and strip it then.
That's good news!

I'll look and see if it's possible to add a simple hack to check to see if a redirected filename begins with a ` and strip it then.
Escaping (I think you meant ^?) will not work (my findings...) as soon there's a space character in the file name, and, to quote I would have to find all the special characters in my string, where when using `s I only would have to "embrace" it (not a big deal though...).