Overview
SHA1 Hash: | 141c31792b66447284b5cc668844fa8b1c85ee4a |
---|---|
Date: | 2008-07-23 17:36:39 |
User: | drh |
Comment: | Do not allow the current repository to be added to the set of files
for a repository. Ticket |
Timelines: | ancestors | descendants | both | trunk |
Other Links: | files | ZIP archive | manifest |
Tags And Properties
- branch=trunk inherited from [a28c83647d]
- sym-trunk inherited from [a28c83647d]
Changes
[hide diffs]Modified src/add.c from [ca6c08e1bc] to [8c54ff6ce9].
@@ -38,17 +38,21 @@ ** at the next commit. */ void add_cmd(void){ int i; int vid; + Blob repo; db_must_be_within_tree(); vid = db_lget_int("checkout",0); if( vid==0 ){ fossil_panic("no checkout to add to"); } db_begin_transaction(); + if( !file_tree_name(g.zRepositoryName, &repo, 0) ){ + blob_zero(&repo); + } for(i=2; i<g.argc; i++){ char *zName; char *zPath; Blob pathname; int isDir; @@ -65,10 +69,11 @@ file_tree_name(zName, &pathname, 1); zPath = blob_str(&pathname); if( strcmp(zPath, "manifest")==0 || strcmp(zPath, "_FOSSIL_")==0 || strcmp(zPath, "manifest.uuid")==0 + || blob_compare(&pathname, &repo)==0 ){ fossil_warning("cannot add %s", zPath); }else{ if( !file_is_simple_pathname(zPath) ){ fossil_fatal("filename contains illegal characters: %s", zPath);