~ubuntu-branches/ubuntu/maverick/texinfo/maverick

« back to all changes in this revision

Viewing changes to lib/substring.c

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Preining
  • Date: 2005-10-28 15:10:30 UTC
  • mto: (2.1.1 dapper) (3.1.4 hardy)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20051028151030-9nsf2s2k2z3fktjt
Tags: upstream-4.8
ImportĀ upstreamĀ versionĀ 4.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* substring.c -- extract substring.
2
 
   $Id: substring.c,v 1.1 1999/02/17 22:30:10 karl Exp $
 
2
   $Id: substring.c,v 1.2 2004/04/11 17:56:46 karl Exp $
3
3
 
4
 
   Copyright (C) 1999 Free Software Foundation, Inc.
 
4
   Copyright (C) 1999, 2004 Free Software Foundation, Inc.
5
5
 
6
6
   This program is free software; you can redistribute it and/or modify
7
7
   it under the terms of the GNU General Public License as published by
20
20
#include "system.h"
21
21
 
22
22
char *
23
 
substring (start, end)
24
 
     char *start;
25
 
     char *end;
 
23
substring (const char *start, const char *end)
26
24
{
27
25
  char *result = xmalloc (end - start + 1);
28
26
  char *scan_result = result;
29
 
  char *scan = start;
 
27
  const char *scan = start;
30
28
 
31
29
  while (scan < end)
32
30
    *scan_result++ = *scan++;