Fossil

Check-in [26ad1bce49]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:On Cygwin determine home directory the same as on win32, so cygwin can share "_fossil" with win32.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 26ad1bce495990397b2a49dd229e6cb607923c00
User & Date: jan.nijtmans 2013-02-27 09:46:46.518
Context
2013-02-27
13:51
plug minor memory leak check-in: 52fb2a71ad user: jan.nijtmans tags: trunk
11:26
merge trunk check-in: d085eb9aca user: jan.nijtmans tags: use-blob_strip_bom
10:03
merge trunk check-in: dbf96517f2 user: jan.nijtmans tags: improve_commit_warning
09:54
merge trunk check-in: efe9993f2b user: jan.nijtmans tags: ticket-d17d6e5b17
09:46
On Cygwin determine home directory the same as on win32, so cygwin can share "_fossil" with win32. check-in: 26ad1bce49 user: jan.nijtmans tags: trunk
08:49
A few more places where Cygwin should do the same as win32. check-in: 8cc71be05f user: jan.nijtmans tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/db.c.
27
28
29
30
31
32
33



34
35
36
37
38
39
40
**    (3)  A local checkout database named "_FOSSIL_" or ".fslckout"
**         and located at the root of the local copy of the source tree.
**
*/
#include "config.h"
#if ! defined(_WIN32)
#  include <pwd.h>



#endif
#include <sqlite3.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <time.h>
#include "db.h"







>
>
>







27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
**    (3)  A local checkout database named "_FOSSIL_" or ".fslckout"
**         and located at the root of the local copy of the source tree.
**
*/
#include "config.h"
#if ! defined(_WIN32)
#  include <pwd.h>
#  if defined(__CYGWIN__)
#    include <sys/cygwin.h>
#  endif
#endif
#include <sqlite3.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <time.h>
#include "db.h"
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807









808
809
810
811
812
813
814
** connection so that we can join between the various databases.  In that
** case, invoke this routine with useAttach as 1.
*/
void db_open_config(int useAttach){
  char *zDbName;
  const char *zHome;
  if( g.configOpen ) return;
#if defined(_WIN32)
  zHome = fossil_getenv("LOCALAPPDATA");
  if( zHome==0 ){
    zHome = fossil_getenv("APPDATA");
    if( zHome==0 ){
      char *zDrive = fossil_getenv("HOMEDRIVE");
      zHome = fossil_getenv("HOMEPATH");
      if( zDrive && zHome ) zHome = mprintf("%s%s", zDrive, zHome);
    }
  }









  if( zHome==0 ){
    fossil_fatal("cannot locate home directory - "
                "please set the LOCALAPPDATA or APPDATA or HOMEPATH "
                "environment variables");
  }
#else
  zHome = fossil_getenv("HOME");







|









>
>
>
>
>
>
>
>
>







794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
** connection so that we can join between the various databases.  In that
** case, invoke this routine with useAttach as 1.
*/
void db_open_config(int useAttach){
  char *zDbName;
  const char *zHome;
  if( g.configOpen ) return;
#if defined(_WIN32) || defined(__CYGWIN__)
  zHome = fossil_getenv("LOCALAPPDATA");
  if( zHome==0 ){
    zHome = fossil_getenv("APPDATA");
    if( zHome==0 ){
      char *zDrive = fossil_getenv("HOMEDRIVE");
      zHome = fossil_getenv("HOMEPATH");
      if( zDrive && zHome ) zHome = mprintf("%s%s", zDrive, zHome);
    }
  }
#if defined(__CYGWIN__)
  if( zHome!=0 ){
    /* We now have the win32 path, but we need the Cygwin equivalent */
    ssize_t size = cygwin_conv_path(CCP_WIN_A_TO_POSIX, zHome, 0, 0);
    char *converted = fossil_malloc(size);
    cygwin_conv_path(CCP_WIN_A_TO_POSIX, zHome, converted, size);
    zHome = converted;
  }
#endif
  if( zHome==0 ){
    fossil_fatal("cannot locate home directory - "
                "please set the LOCALAPPDATA or APPDATA or HOMEPATH "
                "environment variables");
  }
#else
  zHome = fossil_getenv("HOME");