- Timestamp:
- Dec 29, 2008 12:24:20 AM (16 years ago)
- Location:
- trunk/src/kmk
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/function.c
r2153 r2154 2541 2541 2542 2542 /* 2543 $(translate string, new-set[, old-set[, pad-char]])2543 $(translate string, from-set[, to-set[, pad-char]]) 2544 2544 2545 2545 XXX: This doesn't take multibyte locales into account. … … 2548 2548 func_translate (char *o, char **argv, const char *funcname UNUSED) 2549 2549 { 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] : ""; 2553 2553 char trans_tab[1 << CHAR_BIT]; 2554 2554 int i; … … 2559 2559 trans_tab[i] = i; 2560 2560 2561 while ( (i = * old_set) != '\0'2562 && (ch = * new_set) != '\0')2561 while ( (i = *from_set) != '\0' 2562 && (ch = *to_set) != '\0') 2563 2563 { 2564 2564 trans_tab[i] = ch; 2565 old_set++;2566 new_set++;2565 from_set++; 2566 to_set++; 2567 2567 } 2568 2568 … … 2578 2578 ch = ' '; 2579 2579 } 2580 while ((i = * old_set++) != '\0')2580 while ((i = *from_set++) != '\0') 2581 2581 trans_tab[i] = ch; 2582 2582 }
Note:
See TracChangeset
for help on using the changeset viewer.