Comment 7 for bug 422298

Revision history for this message
Alexander Korolkov (telgnik) wrote :

Looks like I've fixed this bug (see attached patch).

Some characters in dash are escaped for internal use (сшуЁ in UTF-8 = d1 81 d1 88 d1 83 d0 81 is translated to d1 81 81 d1 81 88 d1 81 83 d0 81 81), then unescaped. But redirection-to-file strings are treated differently and are unescaped twice (d1 81 81 d1 81 88 d1 81 83 d0 81 81 -> d1 81 d1 88 d1 83 d0 81 -> d1 d1 d1 83 d0), in expandarg() function at src/expand.c (in argstr(), then in rmescapes()).

By the way, EXP_REDIR flag is used only for this special treatment of redirection-to-file strings. Could not find its origin, the oldest commit at git://git.kernel.org/pub/scm/utils/dash/dash.git already has it.