~ubuntu-branches/ubuntu/intrepid/ruby1.9/intrepid-updates

« back to all changes in this revision

Viewing changes to utf8.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-09-04 16:01:17 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20070904160117-i15zckg2nhxe9fyw
Tags: 1.9.0+20070830-2ubuntu1
* Sync from Debian; remaining changes:
  - Add -g to CFLAGS.
* Fixes build failure on ia64.
* Fixes build failure with gcc-4.2 on lpia.
* Robustify check for target_os, fixing build failure on lpia.
* Set Ubuntu maintainer address.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
  utf8.c -  Oniguruma (regular expression library)
3
3
**********************************************************************/
4
4
/*-
5
 
 * Copyright (c) 2002-2006  K.Kosako  <sndgk393 AT ybb DOT ne DOT jp>
 
5
 * Copyright (c) 2002-2007  K.Kosako  <sndgk393 AT ybb DOT ne DOT jp>
6
6
 * All rights reserved.
7
7
 *
8
8
 * Redistribution and use in source and binary forms, with or without
72
72
    if (*p == 0x0a) return 1;
73
73
 
74
74
#ifdef USE_UNICODE_ALL_LINE_TERMINATORS
 
75
#ifndef USE_CRNL_AS_LINE_TERMINATOR
75
76
    if (*p == 0x0d) return 1;
 
77
#endif
76
78
    if (p + 1 < end) {
77
79
      if (*(p+1) == 0x85 && *p == 0xc2) /* U+0085 */
78
80
        return 1;
133
135
  else if (code == INVALID_CODE_FF) return 1;
134
136
#endif
135
137
  else
136
 
    return ONIGENCERR_TOO_BIG_WIDE_CHAR_VALUE;
 
138
    return ONIGENC_ERR_TOO_BIG_WIDE_CHAR_VALUE;
137
139
}
138
140
 
139
141
#if 0
154
156
    else if ((code & 0x80000000) == 0)
155
157
      return ((code>>30) & 0x01) | 0xfc;
156
158
    else {
157
 
      return ONIGENCERR_TOO_BIG_WIDE_CHAR_VALUE;
 
159
      return ONIGENC_ERR_TOO_BIG_WIDE_CHAR_VALUE;
158
160
    }
159
161
  }
160
162
}
209
211
    }
210
212
#endif
211
213
    else {
212
 
      return ONIGENCERR_TOO_BIG_WIDE_CHAR_VALUE;
 
214
      return ONIGENC_ERR_TOO_BIG_WIDE_CHAR_VALUE;
213
215
    }
214
216
 
215
217
    *p++ = UTF8_TRAIL0(code);