3 /* substring.c -- extract substring.
4 Id: substring.c,v 1.2 2004/04/11 17:56:46 karl Exp
6 Copyright (C) 1999, 2004 Free Software Foundation, Inc.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License along
19 with this program; if not, write to the Free Software Foundation, Inc.,
20 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
25 substring (const char *start
, const char *end
)
27 char *result
= xmalloc (end
- start
+ 1);
28 char *scan_result
= result
;
29 const char *scan
= start
;
32 *scan_result
++ = *scan
++;