1N/A/*
1N/A * Copyright (c) 2001 Sendmail, Inc. and its suppliers.
1N/A * All rights reserved.
1N/A *
1N/A * By using this file, you agree to the terms and conditions set
1N/A * forth in the LICENSE file which can be found at the top level of
1N/A * the sendmail distribution.
1N/A *
1N/A */
1N/A
1N/A#pragma ident "%Z%%M% %I% %E% SMI"
1N/A
1N/A#include <sm/gen.h>
1N/ASM_RCSID("@(#)$Id: string.c,v 1.1 2001/02/15 21:04:50 ca Exp $")
1N/A
1N/A#include <ctype.h>
1N/A#include <errno.h>
1N/A
1N/A#include <sm/string.h>
1N/A
1N/A/*
1N/A** STRIPQUOTES -- Strip quotes & quote bits from a string.
1N/A**
1N/A** Runs through a string and strips off unquoted quote
1N/A** characters and quote bits. This is done in place.
1N/A**
1N/A** Parameters:
1N/A** s -- the string to strip.
1N/A**
1N/A** Returns:
1N/A** none.
1N/A**
1N/A** Side Effects:
1N/A** none.
1N/A*/
1N/A
1N/Avoid
1N/Astripquotes(s)
1N/A char *s;
1N/A{
1N/A register char *p;
1N/A register char *q;
1N/A register char c;
1N/A
1N/A if (s == NULL)
1N/A return;
1N/A
1N/A p = q = s;
1N/A do
1N/A {
1N/A c = *p++;
1N/A if (c == '\\')
1N/A c = *p++;
1N/A else if (c == '"')
1N/A continue;
1N/A *q++ = c;
1N/A } while (c != '\0');
1N/A}