VirtualBox

Changeset 2154 in kBuild for trunk/src


Ignore:
Timestamp:
Dec 29, 2008 12:24:20 AM (16 years ago)
Author:
bird
Message:

kmk: $(translate ) changes and testcase.

Location:
trunk/src/kmk
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/function.c

    r2153 r2154  
    25412541
    25422542/*
    2543   $(translate string, new-set[, old-set[, pad-char]])
     2543  $(translate string, from-set[, to-set[, pad-char]])
    25442544
    25452545  XXX: This doesn't take multibyte locales into account.
     
    25482548func_translate (char *o, char **argv, const char *funcname UNUSED)
    25492549{
    2550   const unsigned char *str     = (const unsigned char *)argv[0];
    2551   const unsigned char *new_set = (const unsigned char *)argv[1];
    2552   const char          *old_set = argv[2] != NULL ? argv[2] : "";
     2550  const unsigned char *str      = (const unsigned char *)argv[0];
     2551  const unsigned char *from_set = (const unsigned char *)argv[1];
     2552  const char          *to_set  = argv[2] != NULL ? argv[2] : "";
    25532553  char                 trans_tab[1 << CHAR_BIT];
    25542554  int                  i;
     
    25592559    trans_tab[i] = i;
    25602560
    2561   while (   (i = *old_set) != '\0'
    2562          && (ch = *new_set) != '\0')
     2561  while (   (i = *from_set) != '\0'
     2562         && (ch = *to_set) != '\0')
    25632563    {
    25642564      trans_tab[i] = ch;
    2565       old_set++;
    2566       new_set++;
     2565      from_set++;
     2566      to_set++;
    25672567    }
    25682568
     
    25782578            ch = ' ';
    25792579        }
    2580       while ((i = *old_set++) != '\0')
     2580      while ((i = *from_set++) != '\0')
    25812581        trans_tab[i] = ch;
    25822582    }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette