Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Dequote \hh in filenames as \xhh; both \20 and \x20 are space now (FS…
…P-1011)
  • Loading branch information
pgul committed Feb 25, 2002
1 parent bd20957 commit b4e7b17
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tools.c
Expand Up @@ -15,6 +15,9 @@
* $Id$
*
* $Log$
* Revision 2.6 2002/02/25 21:33:56 gul
* Dequote \hh in filenames as \xhh; both \20 and \x20 are space now (FSP-1011)
*
* Revision 2.5 2001/11/08 14:04:12 gul
* bugfix
*
Expand Down Expand Up @@ -440,13 +443,18 @@ char *strdequote (char *s)

while (*s)
{
#define XD(x) (isdigit(x) ? ((x)-'0') : (tolower(x)-'a'+10))
if (s[0] == '\\' && s[1] == 'x' && isxdigit (s[2]) && isxdigit (s[3]))
{
#define XD(x) (isdigit(x) ? ((x)-'0') : (tolower(x)-'a'+10))
r[i++] = XD (s[2]) * 16 + XD (s[3]);
s += 4;
#undef XD
}
else if (s[0] == '\\' && isxdigit (s[1]) && isxdigit (s[2]))
{
r[i++] = XD (s[1]) * 16 + XD (s[2]);
s += 3;
}
#undef XD
else
r[i++] = *(s++);
}
Expand Down

0 comments on commit b4e7b17

Please sign in to comment.