Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
59948c12
...
59948c12fe91a189a0b15b483f6247f1cabc6918
authored
2003-08-20 14:37:48 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(argcv_unescape_char,argcv_escape_char): New functions.
1 parent
f5bb3117
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
include/mailutils/argcv.h
mailbox/argcv.c
include/mailutils/argcv.h
View file @
59948c1
...
...
@@ -40,6 +40,8 @@ extern int argcv_get __P ((const char *command, const char *delim,
int
*
argc
,
char
***
argv
));
extern
int
argcv_string
__P
((
int
argc
,
char
**
argv
,
char
**
string
));
extern
int
argcv_free
__P
((
int
argc
,
char
**
argv
));
extern
int
argcv_unescape_char
__P
((
int
c
));
extern
int
argcv_escape_char
__P
((
int
c
));
#ifdef __cplusplus
}
...
...
mailbox/argcv.c
View file @
59948c1
...
...
@@ -93,8 +93,8 @@ argcv_scan (int len, const char *command, const char *delim, const char* cmnt,
static
char
escape_transtab
[]
=
"
\\\\
a
\a
b
\b
f
\f
n
\n
r
\r
t
\t
"
;
static
int
unescape_char
(
int
c
)
int
argcv_
unescape_char
(
int
c
)
{
char
*
p
;
...
...
@@ -106,8 +106,8 @@ unescape_char (int c)
return
c
;
}
static
int
escape_char
(
int
c
)
int
argcv_
escape_char
(
int
c
)
{
char
*
p
;
...
...
@@ -154,7 +154,7 @@ escaped_length (const char *str, int *quote)
}
else
if
(
isprint
(
*
str
))
len
++
;
else
if
(
escape_char
(
*
str
)
!=
-
1
)
else
if
(
argcv_
escape_char
(
*
str
)
!=
-
1
)
len
+=
2
;
else
len
+=
4
;
...
...
@@ -226,7 +226,7 @@ unescape_copy (char *dst, const char *src, size_t n)
break
;
default:
*
dst
++
=
unescape_char
(
*
src
++
);
*
dst
++
=
argcv_
unescape_char
(
*
src
++
);
n
--
;
}
}
...
...
@@ -252,7 +252,7 @@ escape_copy (char *dst, const char *src)
*
dst
++
=
*
src
;
else
{
int
c
=
escape_char
(
*
src
);
int
c
=
argcv_
escape_char
(
*
src
);
*
dst
++
=
'\\'
;
if
(
c
!=
-
1
)
*
dst
++
=
c
;
...
...
Please
register
or
sign in
to post a comment