source: trunk/third/sendmail/libsm/string.c @ 19204

Revision 19204, 950 bytes checked in by zacheiss, 22 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r19203, which included commits to RCS files with non-trunk default branches.
Line 
1/*
2 * Copyright (c) 2001 Sendmail, Inc. and its suppliers.
3 *      All rights reserved.
4 *
5 * By using this file, you agree to the terms and conditions set
6 * forth in the LICENSE file which can be found at the top level of
7 * the sendmail distribution.
8 *
9 */
10
11#include <sm/gen.h>
12SM_RCSID("@(#)$Id: string.c,v 1.1.1.1 2003-04-08 15:06:05 zacheiss Exp $")
13
14#include <ctype.h>
15#include <errno.h>
16
17#include <sm/string.h>
18
19/*
20**  STRIPQUOTES -- Strip quotes & quote bits from a string.
21**
22**      Runs through a string and strips off unquoted quote
23**      characters and quote bits.  This is done in place.
24**
25**      Parameters:
26**              s -- the string to strip.
27**
28**      Returns:
29**              none.
30**
31**      Side Effects:
32**              none.
33*/
34
35void
36stripquotes(s)
37        char *s;
38{
39        register char *p;
40        register char *q;
41        register char c;
42
43        if (s == NULL)
44                return;
45
46        p = q = s;
47        do
48        {
49                c = *p++;
50                if (c == '\\')
51                        c = *p++;
52                else if (c == '"')
53                        continue;
54                *q++ = c;
55        } while (c != '\0');
56}
Note: See TracBrowser for help on using the repository browser.