Ignore:
Timestamp:
Jan 21, 2018, 12:10:09 AM (6 years ago)
Author:
coas-nagasima
Message:

prototoolに関連するプロジェクトをnewlibからmuslを使うよう変更・更新
ntshellをnewlibの下位の実装から、muslのsyscallの実装に変更・更新
以下のOSSをアップデート
・mruby-1.3.0
・musl-1.1.18
・onigmo-6.1.3
・tcc-0.9.27
以下のOSSを追加
・openssl-1.1.0e
・curl-7.57.0
・zlib-1.2.11
以下のmrbgemsを追加
・iij/mruby-digest
・iij/mruby-env
・iij/mruby-errno
・iij/mruby-iijson
・iij/mruby-ipaddr
・iij/mruby-mock
・iij/mruby-require
・iij/mruby-tls-openssl

Location:
EcnlProtoTool/trunk/onigmo-6.1.3
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • EcnlProtoTool/trunk/onigmo-6.1.3/src/regerror.c

    r321 r331  
    44/*-
    55 * Copyright (c) 2002-2007  K.Kosako  <sndgk393 AT ybb DOT ne DOT jp>
    6  * Copyright (c) 2011-2014  K.Takata  <kentkt AT csc DOT jp>
     6 * Copyright (c) 2011-2016  K.Takata  <kentkt AT csc DOT jp>
    77 * All rights reserved.
    88 *
     
    3232#include <stdio.h> /* for vsnprintf() */
    3333
    34 #ifdef HAVE_STDARG_PROTOTYPES
    3534#include <stdarg.h>
    36 #define va_init_list(a,b) va_start(a,b)
    37 #else
    38 #include <varargs.h>
    39 #define va_init_list(a,b) va_start(a)
    40 #endif
    4135
    4236extern UChar*
     
    6660  case ONIGERR_MATCH_STACK_LIMIT_OVER:
    6761    p = "match-stack limit over"; break;
     62  case ONIGERR_PARSE_DEPTH_LIMIT_OVER:
     63    p = "parse depth limit over"; break;
    6864  case ONIGERR_DEFAULT_ENCODING_IS_NOT_SET:
    6965    p = "default multibyte-encoding is not set"; break;
     
    180176  case ONIGERR_INVALID_COMBINATION_OF_OPTIONS:
    181177    p = "invalid combination of options"; break;
    182   case ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT:
    183     p = "over thread pass limit count"; break;
    184178
    185179  default:
     
    192186static void sprint_byte(char* s, unsigned int v)
    193187{
    194   sprintf(s, "%02x", (v & 0377));
     188  xsnprintf(s, 3, "%02x", (v & 0377));
    195189}
    196190
    197191static void sprint_byte_with_x(char* s, unsigned int v)
    198192{
    199   sprintf(s, "\\x%02x", (v & 0377));
     193  xsnprintf(s, 5, "\\x%02x", (v & 0377));
    200194}
    201195
     
    233227      }
    234228
    235       p += enclen(enc, p);
     229      p += enclen(enc, p, end);
    236230      if (len >= buf_size) break;
    237231    }
     
    253247
    254248extern int
    255 #ifdef HAVE_STDARG_PROTOTYPES
    256249onig_error_code_to_str(UChar* s, OnigPosition code, ...)
    257 #else
    258 onig_error_code_to_str(s, code, va_alist)
    259   UChar* s;
    260   OnigPosition code;
    261   va_dcl
    262 #endif
    263250{
    264251  UChar *p, *q;
     
    269256  va_list vargs;
    270257
    271   va_init_list(vargs, code);
     258  va_start(vargs, code);
    272259
    273260  switch (code) {
     
    324311}
    325312
    326 
    327313void
    328 #ifdef HAVE_STDARG_PROTOTYPES
    329 onig_snprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc,
    330                            UChar* pat, UChar* pat_end, const UChar *fmt, ...)
    331 #else
    332 onig_snprintf_with_pattern(buf, bufsize, enc, pat, pat_end, fmt, va_alist)
    333     UChar buf[];
    334     int bufsize;
    335     OnigEncoding enc;
    336     UChar* pat;
    337     UChar* pat_end;
    338     const UChar *fmt;
    339     va_dcl
    340 #endif
     314onig_vsnprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc,
     315                           UChar* pat, UChar* pat_end, const UChar *fmt, va_list args)
    341316{
    342317  size_t need;
     
    344319  UChar *p, *s, *bp;
    345320  UChar bs[6];
    346   va_list args;
    347 
    348   va_init_list(args, fmt);
     321
    349322  n = xvsnprintf((char* )buf, bufsize, (const char* )fmt, args);
    350   va_end(args);
    351323
    352324  need = (pat_end - pat) * 4 + 4;
    353325
    354326  if (n + need < (size_t )bufsize) {
    355     strcat((char* )buf, ": /");
     327    static const char sep[] = ": /";
     328    memcpy((char* )buf + n, sep, sizeof(sep));
    356329    s = buf + onigenc_str_bytelen_null(ONIG_ENCODING_ASCII, buf);
    357330
    358331    p = pat;
    359332    while (p < pat_end) {
    360       if (*p == '\\') {
    361         *s++ = *p++;
    362         len = enclen(enc, p);
    363         while (len-- > 0) *s++ = *p++;
    364       }
    365       else if (*p == '/') {
    366         *s++ = (unsigned char )'\\';
    367         *s++ = *p++;
    368       }
    369       else if (ONIGENC_IS_MBC_HEAD(enc, p)) {
    370         len = enclen(enc, p);
     333      if (ONIGENC_IS_MBC_HEAD(enc, p, pat_end)) {
     334        len = enclen(enc, p, pat_end);
    371335        if (ONIGENC_MBC_MINLEN(enc) == 1) {
    372336          while (len-- > 0) *s++ = *p++;
    373337        }
    374         else { /* for UTF16 */
     338        else { /* for UTF16/32 */
    375339          int blen;
    376340
     
    383347        }
    384348      }
     349      else if (*p == '\\') {
     350        *s++ = *p++;
     351        len = enclen(enc, p, pat_end);
     352        while (len-- > 0) *s++ = *p++;
     353      }
     354      else if (*p == '/') {
     355        *s++ = (unsigned char )'\\';
     356        *s++ = *p++;
     357      }
    385358      else if (!ONIGENC_IS_CODE_PRINT(enc, *p) &&
    386359               !ONIGENC_IS_CODE_SPACE(enc, *p)) {
     
    399372  }
    400373}
     374
     375#if 0 /* unused */
     376void
     377onig_snprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc,
     378                           UChar* pat, UChar* pat_end, const UChar *fmt, ...)
     379{
     380  va_list args;
     381  va_start(args, fmt);
     382  onig_vsnprintf_with_pattern(buf, bufsize, enc,
     383          pat, pat_end, fmt, args);
     384  va_end(args);
     385}
     386#endif
Note: See TracChangeset for help on using the changeset viewer.