Ignore:
Timestamp:
May 25, 2006, 2:00:37 PM (14 years ago)
Author:
bcornec
Message:

2.08 synced with stable as of r575
VERSION files updated

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0.8/mondo/mondo/common/libmondo-string.c

    r128 r576  
    1 /* libmondo-string.c
    2    $Id$
    3 
    4 - string manipulation
    5 
    6 
    7 08/02
    8 - added function turn_wildcard_chars_into_literal_chars()
    9 
    10 03/10/2004?
    11 - make percent_media_full_comment() use media_descriptor_string():
    12   "DVD %d" or "ISO %d" (if that's what it is) rather than "CD %d"
    13 - fix build_partition_name() to use 'adXsY' rather than 'adXpY' on FreeBSD
    14 
    15 10/08/2003
    16 - changed 'CD %d' to '<media> %d' (msg)
    17 
    18 10/01
    19 - fixing strip_spaces() to handle /r properly
    20 
    21 09/26
    22 - added char *media_descriptor_string(t_bkptype);
    23 
    24 05/06
    25 - cleaned up severity_of_difference() a bit
    26 
    27 05/05
    28 - added Joshua Oreman's FreeBSD patches
    29 
    30 04/24
    31 - added lots of assert()'s and log_OS_error()'s
    32 - severity_of_difference() skips "/mnt/RESTORING" at start
    33   of filename if it's there
    34 
    35 04/04/2003
    36 - misc clean-up (Tom Mortell)
    37 
    38 11/17/2002
    39 - strip_spaces() now accommodates _smaller_ strings auto'y
    40 
    41 11/08
    42 - if decimal point in string sent to friendly_sizestr_to_sizelong()
    43   then fatal error: we expect integers only
    44 
    45 10/01 - 10/31
    46 - commented subroutines
    47 - strip_spaces() allows up to MAX_STR_LEN-len input string
    48 
    49 08/01 - 08/31
    50 - fixed bug in friendly_sizestr_to_sizelong() which stopped
    51   it from working with capital G's and K's
    52 - fixed bug in build_partition_name()
    53 
    54 07/24
    55 - created
    56 */
     1/* $Id$ */
    572
    583
     
    12121157}
    12131158
     1159
     1160/* New functions safe from a memory manageemnt point of view */
     1161/* Developped by Andree Leidenfrost */
     1162
     1163char *mr_strtok(char *instr, const char *delims, int *lastpos) {
     1164
     1165char *token = NULL;
     1166char *strptr = NULL;
     1167size_t pos1 = 0;
     1168size_t pos2 = 0;
     1169
     1170if (strlen(instr) <= *lastpos) {
     1171    *lastpos = 0;
     1172    return token;
     1173}
     1174
     1175strptr = instr + *lastpos;
     1176pos2 = strspn(strptr, delims);
     1177strptr += pos2;
     1178pos1 = strcspn(strptr, delims);
     1179token = malloc(sizeof(*token)*(pos1+1));
     1180strncpy(token, strptr, pos1);
     1181*lastpos = *lastpos + pos1 + pos2 + 1;
     1182
     1183return token;
     1184}
    12141185/* @} - end of stringGroup */
Note: See TracChangeset for help on using the changeset viewer.