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

« back to all changes in this revision

Viewing changes to ncurses/base/lib_insch.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2008-12-14 21:06:00 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20081214210600-2rdjwvpplgvh3zeb
Tags: 5.7+20081213-1
MergingĀ upstreamĀ versionĀ 5.7+20081213.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/****************************************************************************
2
 
 * Copyright (c) 1998-2004,2005 Free Software Foundation, Inc.              *
 
2
 * Copyright (c) 1998-2005,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            *
43
43
#include <curses.priv.h>
44
44
#include <ctype.h>
45
45
 
46
 
MODULE_ID("$Id: lib_insch.c,v 1.24 2005/02/26 19:27:28 tom Exp $")
 
46
MODULE_ID("$Id: lib_insch.c,v 1.25 2008/02/03 00:14:37 tom Exp $")
47
47
 
48
48
/*
49
49
 * Insert the given character, updating the current location to simplify
95
95
        } else if (is8bits(ChCharOf(ch)) && iscntrl(ChCharOf(ch))) {
96
96
            s = unctrl(ChCharOf(ch));
97
97
            while (*s != '\0') {
98
 
                if ((code = _nc_insert_ch(win, ChAttrOf(ch) | UChar(*s))) != OK)
 
98
                code = _nc_insert_ch(win, ChAttrOf(ch) | UChar(*s));
 
99
                if (code != OK)
99
100
                    break;
100
101
                ++s;
101
102
            }
107
108
             */
108
109
            SetChar2(wch, ch);
109
110
            wch = _nc_render(win, wch);
110
 
            if (_nc_build_wch(win, &wch) >= 0)
 
111
            count = _nc_build_wch(win, &wch);
 
112
            if (count > 0) {
111
113
                code = wins_wch(win, &wch);
 
114
            } else if (count == -1) {
 
115
                /* handle EILSEQ */
 
116
                if (is8bits(ch)) {
 
117
                    s = unctrl(ChCharOf(ch));
 
118
                    while (*s != '\0') {
 
119
                        code = _nc_insert_ch(win, ChAttrOf(ch) | UChar(*s));
 
120
                        if (code != OK)
 
121
                            break;
 
122
                        ++s;
 
123
                    }
 
124
                } else {
 
125
                    code = ERR;
 
126
                }
 
127
            }
112
128
        }
113
129
#endif
114
130
        break;