~vcs-imports/logrotate/trunk

« back to all changes in this revision

Viewing changes to basenames.c

  • Committer: pvrabec
  • Date: 2005-11-12 19:07:56 UTC
  • Revision ID: svn-v4:ec1272ba-9ed1-42ef-8245-99669996828e:trunk:225
- new upstream release
- indent sources

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 
6
6
/* Return NAME with any leading path stripped off.  */
7
7
 
8
 
char *ourBaseName(char *name) {
 
8
char *ourBaseName(char *name)
 
9
{
9
10
    char *base;
10
11
 
11
12
    base = strrchr(name, '/');
12
13
    return base ? base + 1 : name;
13
14
}
14
15
 
15
 
static void stripTrailingSlashes(char *path) {
16
 
    char * last;
 
16
static void stripTrailingSlashes(char *path)
 
17
{
 
18
    char *last;
17
19
 
18
20
    last = path + strlen(path) - 1;
19
21
    while (last > path && *last == '/')
20
22
        *last-- = '\0';
21
23
}
22
24
 
23
 
char * ourDirName(char * origname) {
24
 
    char * slash;
25
 
    char * name;
 
25
char *ourDirName(char *origname)
 
26
{
 
27
    char *slash;
 
28
    char *name;
26
29
 
27
30
    name = strdup(origname);
28
31