8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / cmd / sendmail / libsm / string.c
blob9e7715b89cd547e8badce9504b0d8239cd30cf75
1 /*
2 * Copyright (c) 2001 Sendmail, Inc. and its suppliers.
3 * All rights reserved.
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.
9 */
11 #pragma ident "%Z%%M% %I% %E% SMI"
13 #include <sm/gen.h>
14 SM_RCSID("@(#)$Id: string.c,v 1.1 2001/02/15 21:04:50 ca Exp $")
16 #include <ctype.h>
17 #include <errno.h>
19 #include <sm/string.h>
22 ** STRIPQUOTES -- Strip quotes & quote bits from a string.
24 ** Runs through a string and strips off unquoted quote
25 ** characters and quote bits. This is done in place.
27 ** Parameters:
28 ** s -- the string to strip.
30 ** Returns:
31 ** none.
33 ** Side Effects:
34 ** none.
37 void
38 stripquotes(s)
39 char *s;
41 register char *p;
42 register char *q;
43 register char c;
45 if (s == NULL)
46 return;
48 p = q = s;
51 c = *p++;
52 if (c == '\\')
53 c = *p++;
54 else if (c == '"')
55 continue;
56 *q++ = c;
57 } while (c != '\0');