~ubuntu-branches/ubuntu/natty/ncurses/natty

« back to all changes in this revision

Viewing changes to ncurses/tinfo/comp_expand.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-05-17 09:00:42 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070517090042-86fgxrr6j5jzagot
Tags: 5.6-0ubuntu1
* New upstream version.
  - Remove patches applied upstream: ncurses.upstream, signed-chars.
  - Update patches: debian-backspace.
* Build-depend on g++-multilib instead of lib{32,64}c*-dev-*.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/****************************************************************************
2
 
 * Copyright (c) 1998,2000,2001 Free Software Foundation, Inc.              *
 
2
 * Copyright (c) 1998-2001,2006 Free Software Foundation, Inc.              *
3
3
 *                                                                          *
4
4
 * Permission is hereby granted, free of charge, to any person obtaining a  *
5
5
 * copy of this software and associated documentation files (the            *
35
35
#include <ctype.h>
36
36
#include <tic.h>
37
37
 
38
 
MODULE_ID("$Id: comp_expand.c,v 1.17 2001/09/22 19:16:52 tom Exp $")
 
38
MODULE_ID("$Id: comp_expand.c,v 1.18 2006/06/17 19:37:14 tom Exp $")
39
39
 
40
40
static int
41
41
trailing_spaces(const char *src)
50
50
#define REALPRINT(s) (UChar(*(s)) < 127 && isprint(UChar(*(s))))
51
51
 
52
52
NCURSES_EXPORT(char *)
53
 
_nc_tic_expand
54
 
(const char *srcp, bool tic_format, int numbers)
 
53
_nc_tic_expand(const char *srcp, bool tic_format, int numbers)
55
54
{
56
55
    static char *buffer;
57
56
    static size_t length;
62
61
    size_t need = (2 + strlen(str)) * 4;
63
62
    int ch;
64
63
 
 
64
#if NO_LEAKS
 
65
    if (srcp == 0) {
 
66
        if (buffer != 0) {
 
67
            FreeAndNull(buffer);
 
68
            length = 0;
 
69
        }
 
70
        return 0;
 
71
    }
 
72
#endif
65
73
    if (buffer == 0 || need > length) {
66
74
        if ((buffer = typeRealloc(char, length = need, buffer)) == 0)
67
75
              return 0;