Changeset 178e2f8 for lib


Ignore:
Timestamp:
2008-06-28T17:32:41Z (11 years ago)
Author:
Jelmer Vernooij <jelmer@…>
Branches:
master
Children:
47b571d
Parents:
2e0f24d (diff), e0f9170 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge trunk.

Location:
lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lib/misc.c

    r2e0f24d r178e2f8  
    6060        strcpy(text, text2);
    6161        g_free(text2);
    62 }
    63 
    64 char *normalize(const char *s)
    65 {
    66         static char buf[BUF_LEN];
    67         char *t, *u;
    68         int x = 0;
    69 
    70         g_return_val_if_fail((s != NULL), NULL);
    71 
    72         u = t = g_strdup(s);
    73 
    74         strcpy(t, s);
    75         g_strdown(t);
    76 
    77         while (*t && (x < BUF_LEN - 1)) {
    78                 if (*t != ' ') {
    79                         buf[x] = *t;
    80                         x++;
    81                 }
    82                 t++;
    83         }
    84         buf[x] = '\0';
    85         g_free(u);
    86         return buf;
    8762}
    8863
  • lib/misc.h

    r2e0f24d r178e2f8  
    4141G_MODULE_EXPORT char *add_cr( char *text );
    4242G_MODULE_EXPORT char *strip_newlines(char *source);
    43 G_MODULE_EXPORT char *normalize( const char *s );
    4443
    4544G_MODULE_EXPORT time_t get_time( int year, int month, int day, int hour, int min, int sec );
Note: See TracChangeset for help on using the changeset viewer.