~ubuntu-branches/debian/sid/ncurses/sid-200908151540

« back to all changes in this revision

Viewing changes to ncurses/trace/lib_trace.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2008-11-30 03:43:00 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20081130034300-lw6qrujyjmv6e32x
Tags: 5.7+20081122-2
Adding patch from Samuel Thibault to ensure that aalib checks the
value returned by Gpm_GetEvent() and only proceeds if value == 1
(Closes: #506717).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/****************************************************************************
2
 
 * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              *
 
2
 * Copyright (c) 1998-2007,2008 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            *
30
30
 *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
31
31
 *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
32
32
 *     and: Thomas E. Dickey                        1996-on                 *
33
 
 *     and: Juergen Pfeifer                                                 *
34
33
 ****************************************************************************/
35
34
 
36
35
/*
47
46
 
48
47
#include <ctype.h>
49
48
 
50
 
MODULE_ID("$Id: lib_trace.c,v 1.72 2009/02/28 20:37:37 tom Exp $")
 
49
MODULE_ID("$Id: lib_trace.c,v 1.71 2008/08/23 18:04:29 tom Exp $")
51
50
 
52
51
NCURSES_EXPORT_VAR(unsigned) _nc_tracing = 0; /* always define this */
53
52
 
57
56
NCURSES_EXPORT(const char *)
58
57
NCURSES_PUBLIC_VAR(_nc_tputs_trace) (void)
59
58
{
60
 
    return CURRENT_SCREEN ? CURRENT_SCREEN->_tputs_trace : _nc_prescreen._tputs_trace;
 
59
    return SP ? SP->_tputs_trace : _nc_prescreen._tputs_trace;
61
60
}
62
61
NCURSES_EXPORT(long)
63
62
NCURSES_PUBLIC_VAR(_nc_outchars) (void)
64
63
{
65
 
    return CURRENT_SCREEN ? CURRENT_SCREEN->_outchars : _nc_prescreen._outchars;
 
64
    return SP ? SP->_outchars : _nc_prescreen._outchars;
66
65
}
67
66
NCURSES_EXPORT(void)
68
67
_nc_set_tputs_trace(const char *s)
69
68
{
70
 
    if (CURRENT_SCREEN)
71
 
        CURRENT_SCREEN->_tputs_trace = s;
 
69
    if (SP)
 
70
        SP->_tputs_trace = s;
72
71
    else
73
72
        _nc_prescreen._tputs_trace = s;
74
73
}
75
74
NCURSES_EXPORT(void)
76
75
_nc_count_outchars(long increment)
77
76
{
78
 
    if (CURRENT_SCREEN)
79
 
        CURRENT_SCREEN->_outchars += increment;
 
77
    if (SP)
 
78
        SP->_outchars += increment;
80
79
    else
81
80
        _nc_prescreen._outchars += increment;
82
81
}