~ubuntu-branches/ubuntu/maverick/evolution-data-server/maverick-proposed

« back to all changes in this revision

Viewing changes to libdb/os/os_rpath.c

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-05-17 17:02:06 UTC
  • mfrom: (1.1.79 upstream) (1.6.12 experimental)
  • Revision ID: james.westby@ubuntu.com-20100517170206-4ufr52vwrhh26yh0
Tags: 2.30.1-1ubuntu1
* Merge from debian experimental. Remaining change:
  (LP: #42199, #229669, #173703, #360344, #508494)
  + debian/control:
    - add Vcs-Bzr tag
    - don't use libgnome
    - Use Breaks instead of Conflicts against evolution 2.25 and earlier.
  + debian/evolution-data-server.install,
    debian/patches/45_libcamel_providers_version.patch:
    - use the upstream versioning, not a Debian-specific one 
  + debian/libedata-book1.2-dev.install, debian/libebackend-1.2-dev.install,
    debian/libcamel1.2-dev.install, debian/libedataserverui1.2-dev.install:
    - install html documentation
  + debian/rules:
    - don't build documentation it's shipped with the tarball

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*-
2
 
 * See the file LICENSE for redistribution information.
3
 
 *
4
 
 * Copyright (c) 1997-2002
5
 
 *      Sleepycat Software.  All rights reserved.
6
 
 */
7
 
 
8
 
#include "db_config.h"
9
 
 
10
 
#ifndef lint
11
 
static const char revid[] = "$Id$";
12
 
#endif /* not lint */
13
 
 
14
 
#ifndef NO_SYSTEM_INCLUDES
15
 
#include <string.h>
16
 
#endif
17
 
 
18
 
#include "db_int.h"
19
 
#ifdef HAVE_VXWORKS
20
 
#include "iosLib.h"
21
 
#endif
22
 
 
23
 
/*
24
 
 * __db_rpath --
25
 
 *      Return the last path separator in the path or NULL if none found.
26
 
 *
27
 
 * PUBLIC: char *__db_rpath __P((const char *));
28
 
 */
29
 
char *
30
 
__db_rpath(path)
31
 
        const char *path;
32
 
{
33
 
        const char *s, *last;
34
 
#ifdef HAVE_VXWORKS
35
 
        DEV_HDR *dummy;
36
 
        char *ptail;
37
 
 
38
 
        /*
39
 
         * VxWorks devices can be rooted at any name.  We want to
40
 
         * skip over the device name and not take into account any
41
 
         * PATH_SEPARATOR characters that might be in that name.
42
 
         *
43
 
         * XXX [#2393]
44
 
         * VxWorks supports having a filename directly follow a device
45
 
         * name with no separator.  I.e. to access a file 'xxx' in
46
 
         * the top level directory of a device mounted at "mydrive"
47
 
         * you could say "mydrivexxx" or "mydrive/xxx" or "mydrive\xxx".
48
 
         * We do not support the first usage here.
49
 
         * XXX
50
 
         */
51
 
        if ((dummy = iosDevFind((char *)path, &ptail)) == NULL)
52
 
                s = path;
53
 
        else
54
 
                s = ptail;
55
 
#else
56
 
        s = path;
57
 
#endif
58
 
 
59
 
        last = NULL;
60
 
        if (PATH_SEPARATOR[1] != '\0') {
61
 
                for (; s[0] != '\0'; ++s)
62
 
                        if (strchr(PATH_SEPARATOR, s[0]) != NULL)
63
 
                                last = s;
64
 
        } else
65
 
                for (; s[0] != '\0'; ++s)
66
 
                        if (s[0] == PATH_SEPARATOR[0])
67
 
                                last = s;
68
 
        return ((char *)last);
69
 
}