Changeset 843 for trunk/src/ash/bltin/printf.c
- Timestamp:
- Feb 4, 2007, 1:09:12 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/ash/bltin/printf.c
r626 r843 30 30 */ 31 31 32 #ifdef HAVE_SYS_CDEFS_H 32 33 #include <sys/cdefs.h> 34 #endif 33 35 #ifndef lint 34 36 #if !defined(BUILTIN) && !defined(SHELL) … … 77 79 static char *mklong(const char *, int); 78 80 static void check_conversion(const char *, const char *); 79 static void usage(void); 81 static void usage(void); 80 82 81 83 static void b_count(int); … … 158 160 * Basic algorithm is to scan the format string for conversion 159 161 * specifications -- once one is found, find out if the field 160 * width or precision is a '*'; if it is, gather up value. 162 * width or precision is a '*'; if it is, gather up value. 161 163 * Note, format strings are reused as necessary to use up the 162 * provided arguments, arguments of zero/null string are 164 * provided arguments, arguments of zero/null string are 163 165 * provided to use up the format string. 164 166 */ … … 322 324 323 325 /* 324 * Print SysV echo(1) style escape string 326 * Print SysV echo(1) style escape string 325 327 * Halts processing string if a \c escape is encountered. 326 328 */ … … 345 347 } 346 348 347 /* 349 /* 348 350 * %b string octal constants are not like those in C. 349 * They start with a \0, and are followed by 0, 1, 2, 350 * or 3 octal digits. 351 * They start with a \0, and are followed by 0, 1, 2, 352 * or 3 octal digits. 351 353 */ 352 354 if (ch == '0') { … … 390 392 391 393 /* 392 * Print "standard" escape characters 394 * Print "standard" escape characters 393 395 */ 394 396 static char * … … 519 521 { 520 522 static char copy[64]; 521 size_t len; 523 size_t len; 522 524 523 525 len = strlen(str) + 2; … … 530 532 copy[len - 2] = ch; 531 533 copy[len - 1] = '\0'; 532 return copy; 534 return copy; 533 535 } 534 536
Note:
See TracChangeset
for help on using the changeset viewer.