~ubuntu-branches/ubuntu/vivid/gedit/vivid

« back to all changes in this revision

Viewing changes to gedit/gedit-smart-charset-converter.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2010-06-21 15:14:19 UTC
  • mfrom: (1.1.80 upstream)
  • Revision ID: james.westby@ubuntu.com-20100621151419-j79nqokj12vpw9u3
Tags: 2.30.3-0ubuntu1
* New upstream version
  - Misc bugfixes
  - Handle empty input gracefully (lp: #586848)
  - Translations update

Show diffs side-by-side

added added

removed removed

Lines of Context:
139
139
        gboolean ret;
140
140
        gsize out_size;
141
141
 
 
142
        if (inbuf == NULL || inbuf_size == 0)
 
143
        {
 
144
                return FALSE;
 
145
        }
 
146
 
142
147
        err = NULL;
143
148
        nread = 0;
144
149
        nwritten = 0;
200
205
{
201
206
        GCharsetConverter *conv = NULL;
202
207
 
 
208
        if (inbuf == NULL || inbuf_size == 0)
 
209
        {
 
210
                smart->priv->is_utf8 = TRUE;
 
211
                return NULL;
 
212
        }
 
213
 
203
214
        if (smart->priv->encodings != NULL &&
204
215
            smart->priv->encodings->next == NULL)
205
216
                smart->priv->use_first = TRUE;
390
401
        {
391
402
                return (const GeditEncoding *)smart->priv->current_encoding->data;
392
403
        }
 
404
        else if (smart->priv->is_utf8)
 
405
        {
 
406
                return gedit_encoding_get_utf8 ();
 
407
        }
393
408
 
394
409
        return NULL;
395
410
}