Fossil SCM

Make sure it is not possible to add files that are outside of the current checkout.

drh 2014-01-09 13:18 trunk merge
Commit c6f32a262d590d318ab508f6b77a5fbad54ad900
1 file changed +5
+5
--- src/add.c
+++ src/add.c
@@ -270,10 +270,15 @@
270270
/* Load the names of all files that are to be added into sfile temp table */
271271
for(i=2; i<g.argc; i++){
272272
char *zName;
273273
int isDir;
274274
Blob fullName;
275
+
276
+ /* file_tree_name() throws a fatal error if g.argv[i] is outside of the
277
+ ** checkout. */
278
+ file_tree_name(g.argv[i], &fullName, 1);
279
+ blob_reset(&fullName);
275280
276281
file_canonical_name(g.argv[i], &fullName, 0);
277282
zName = blob_str(&fullName);
278283
isDir = file_wd_isdir(zName);
279284
if( isDir==1 ){
280285
--- src/add.c
+++ src/add.c
@@ -270,10 +270,15 @@
270 /* Load the names of all files that are to be added into sfile temp table */
271 for(i=2; i<g.argc; i++){
272 char *zName;
273 int isDir;
274 Blob fullName;
 
 
 
 
 
275
276 file_canonical_name(g.argv[i], &fullName, 0);
277 zName = blob_str(&fullName);
278 isDir = file_wd_isdir(zName);
279 if( isDir==1 ){
280
--- src/add.c
+++ src/add.c
@@ -270,10 +270,15 @@
270 /* Load the names of all files that are to be added into sfile temp table */
271 for(i=2; i<g.argc; i++){
272 char *zName;
273 int isDir;
274 Blob fullName;
275
276 /* file_tree_name() throws a fatal error if g.argv[i] is outside of the
277 ** checkout. */
278 file_tree_name(g.argv[i], &fullName, 1);
279 blob_reset(&fullName);
280
281 file_canonical_name(g.argv[i], &fullName, 0);
282 zName = blob_str(&fullName);
283 isDir = file_wd_isdir(zName);
284 if( isDir==1 ){
285

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button