Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | proposed fix for clobbering existing files [5ba427be8809342c6fbdcf48c9c8365467048d28] |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | clobber_fixer |
| Files: | files | file ages | folders |
| SHA1: |
bb15d408a4d68f8ab853e4dc6d2a00c5 |
| User & Date: | bch 2015-01-29 20:21:43.427 |
References
|
2015-01-29
| ||
| 20:42 | • Ticket [5ba427be88] Fossil clobbers existing files when creating new repo status still Open with 3 other changes artifact: e4b733e177 user: nobody | |
Context
|
2015-01-29
| ||
| 22:15 | move "solution" closer to problem area, rather than too deeply abstracted in the machinery. check-in: 89cf250dda user: bch tags: clobber_fixer | |
| 20:54 | less abstract, closer to affected (clone, init/new) subcommands Closed-Leaf check-in: b0a3bfb038 user: bch tags: clobber_fixer | |
| 20:21 | proposed fix for clobbering existing files [5ba427be8809342c6fbdcf48c9c8365467048d28] check-in: bb15d408a4 user: bch tags: clobber_fixer | |
| 09:14 | Changelog additions, and a single "const" addition check-in: 9586ac14b8 user: jan.nijtmans tags: trunk | |
Changes
Changes to src/db.c.
| ︙ | ︙ | |||
815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 |
/*
** Open a database file. Return a pointer to the new database
** connection. An error results in process abort.
*/
LOCAL sqlite3 *db_open(const char *zDbName){
int rc;
sqlite3 *db;
if( g.fSqlTrace ) fossil_trace("-- sqlite3_open: [%s]\n", zDbName);
rc = sqlite3_open_v2(
zDbName, &db,
SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
g.zVfsName
);
if( rc!=SQLITE_OK ){
db_err("[%s]: %s", zDbName, sqlite3_errmsg(db));
| > > > > > > | 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 |
/*
** Open a database file. Return a pointer to the new database
** connection. An error results in process abort.
*/
LOCAL sqlite3 *db_open(const char *zDbName){
int rc;
sqlite3 *db;
struct stat sb;
if( g.fSqlTrace ) fossil_trace("-- sqlite3_open: [%s]\n", zDbName);
if (0 == stat(zDbName, &sb)) {
db_err("[%s]: %s", zDbName, "File already exists.");
}
rc = sqlite3_open_v2(
zDbName, &db,
SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
g.zVfsName
);
if( rc!=SQLITE_OK ){
db_err("[%s]: %s", zDbName, sqlite3_errmsg(db));
|
| ︙ | ︙ |