Ignore:
Timestamp:
Feb 25, 2011, 9:26:54 PM (13 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.18.3 to avoid problems with the tar command which is now failing on recent versions with busybox 1.7.3
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.9/mindi-busybox/libbb/skip_whitespace.c

    r1765 r2725  
    55 * Copyright (C) 2003  Manuel Novoa III  <mjn3@codepoet.org>
    66 *
    7  * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
     7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
    88 */
    99
    1010#include "libbb.h"
    1111
    12 char *skip_whitespace(const char *s)
     12char* FAST_FUNC skip_whitespace(const char *s)
    1313{
    14     /* NB: isspace('0') returns 0 */
    15     while (isspace(*s)) ++s;
     14    /* In POSIX/C locale (the only locale we care about: do we REALLY want
     15     * to allow Unicode whitespace in, say, .conf files? nuts!)
     16     * isspace is only these chars: "\t\n\v\f\r" and space.
     17     * "\t\n\v\f\r" happen to have ASCII codes 9,10,11,12,13.
     18     * Use that.
     19     */
     20    while (*s == ' ' || (unsigned char)(*s - 9) <= (13 - 9))
     21        s++;
    1622
    1723    return (char *) s;
    1824}
    1925
    20 char *skip_non_whitespace(const char *s)
     26char* FAST_FUNC skip_non_whitespace(const char *s)
    2127{
    22     while (*s && !isspace(*s)) ++s;
     28    while (*s != '\0' && *s != ' ' && (unsigned char)(*s - 9) > (13 - 9))
     29        s++;
    2330
    2431    return (char *) s;
    2532}
     33
     34char* FAST_FUNC skip_dev_pfx(const char *tty_name)
     35{
     36    if (strncmp(tty_name, "/dev/", 5) == 0)
     37        tty_name += 5;
     38    return (char*)tty_name;
     39}
Note: See TracChangeset for help on using the changeset viewer.