Changeset 1020 for trunk/src


Ignore:
Timestamp:
Jan 23, 2004, 3:02:30 AM (22 years ago)
Author:
bird
Message:

Fix from nickk with some additions of my own. Handles the reset/init call.

Location:
trunk/src/emx/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/src/lib/iconv/iconv.c

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r1019 r1020  
    7777       char **out, size_t *out_left)
    7878{
    79   int rc;
    80   size_t sl = *in_left, nonid;
    81   UniChar *ucs = (UniChar *) alloca (sl * sizeof (UniChar));
    82   UniChar *orig_ucs = ucs;
    83   size_t retval = 0;
     79  int       rc;
     80  size_t    sl;
     81  size_t    nonid;
     82  UniChar  *ucs;
     83  UniChar  *orig_ucs;
     84  size_t    retval = 0;
    8485  FS_VAR();
     86
     87  /* just in case. */
     88  if (!conv || conv == (iconv_t)-1)
     89    {
     90      errno = EINVAL;
     91      return -1;
     92    }
     93
     94  /* The caller wish to initate the conversion state and/or write initial
     95     shift prefix (or something like that) to the output buffer. */
     96  if (!in || !*in)
     97    {
     98      if (!out || !*out || !out_left || !*out_left)
     99        /* do nothing since we don't have any shift state in the iconv_t. */
     100        return 0;
     101
     102      /** @todo We don't have any shift state I or so, so what to do now?
     103       *        Let's do nothing till we have anyone complaining about his DBCS
     104       *        stuff not working 100%, and accept patches for that guy.
     105       *        Perhaps try call UniUconvFromUcs(conv->to, and some empty input buffer or so...
     106       */
     107      return 0;
     108    }
     109
     110  sl =  *in_left;
     111  ucs = (UniChar *) alloca (sl * sizeof (UniChar));
     112  orig_ucs = ucs;
    85113
    86114  FS_SAVE_LOAD();
     
    142170iconv_close (iconv_t conv)
    143171{
    144   if (conv != (iconv_t)(-1))
     172  if (!conv && conv != (iconv_t)(-1))
    145173    {
    146174      FS_VAR();
  • trunk/src/emx/src/libiconv/iconv.c

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r1019 r1020  
    7777       char **out, size_t *out_left)
    7878{
    79   int rc;
    80   size_t sl = *in_left, nonid;
    81   UniChar *ucs = (UniChar *) alloca (sl * sizeof (UniChar));
    82   UniChar *orig_ucs = ucs;
    83   size_t retval = 0;
     79  int       rc;
     80  size_t    sl;
     81  size_t    nonid;
     82  UniChar  *ucs;
     83  UniChar  *orig_ucs;
     84  size_t    retval = 0;
    8485  FS_VAR();
     86
     87  /* just in case. */
     88  if (!conv || conv == (iconv_t)-1)
     89    {
     90      errno = EINVAL;
     91      return -1;
     92    }
     93
     94  /* The caller wish to initate the conversion state and/or write initial
     95     shift prefix (or something like that) to the output buffer. */
     96  if (!in || !*in)
     97    {
     98      if (!out || !*out || !out_left || !*out_left)
     99        /* do nothing since we don't have any shift state in the iconv_t. */
     100        return 0;
     101
     102      /** @todo We don't have any shift state I or so, so what to do now?
     103       *        Let's do nothing till we have anyone complaining about his DBCS
     104       *        stuff not working 100%, and accept patches for that guy.
     105       *        Perhaps try call UniUconvFromUcs(conv->to, and some empty input buffer or so...
     106       */
     107      return 0;
     108    }
     109
     110  sl =  *in_left;
     111  ucs = (UniChar *) alloca (sl * sizeof (UniChar));
     112  orig_ucs = ucs;
    85113
    86114  FS_SAVE_LOAD();
     
    142170iconv_close (iconv_t conv)
    143171{
    144   if (conv != (iconv_t)(-1))
     172  if (!conv && conv != (iconv_t)(-1))
    145173    {
    146174      FS_VAR();
Note: See TracChangeset for help on using the changeset viewer.