Fossil

Check-in [b2594738]
Login

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

Overview
Comment:Fix a bug in the "fossil add" command that prevented the adding of symbolic links.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | symlink-refactor
Files: files | file ages | folders
SHA3-256:b2594738460036b9350f8c4ddd72b186ea1f53b536ea38f52bca31c33e56fde3
User & Date: drh 2017-11-30 18:07:53
Context
2017-12-02
13:00
Update a comment due to changes in the purpose of Fossil 2.x. No changes to code. Closed-Leaf check-in: 244b84b8 user: drh tags: symlink-refactor
2017-11-30
18:07
Fix a bug in the "fossil add" command that prevented the adding of symbolic links. check-in: b2594738 user: drh tags: symlink-refactor
17:58
Refactor the symlink processing logic so that most of the file access routines take a new parameter indicating the conditions under which symlinks should and should not be followed. This should fix a few bugs related to symlink processing. Lots of testing required before merging to trunk. check-in: e7767de2 user: drh tags: symlink-refactor
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/file.c.

337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
  zFN = mprintf("%s", zFilename);
  file_simplify_name(zFN, -1, 0);
  rc = getStat(zFN, eFType);
  if( rc ){
    rc = 0; /* It does not exist at all. */
  }else if( S_ISDIR(fx.fileStat.st_mode) ){
    rc = 1; /* It exists and is a real directory. */
  }else if( S_ISLNK(fx.fileStat.st_mode) ){
    Blob content;
    blob_read_link(&content, zFN); /* It exists and is a link. */
    rc = file_isdir(blob_str(&content), eFType); /* Points to directory? */
    blob_reset(&content);
  }else{
    rc = 2; /* It exists and is something else. */
  }
  free(zFN);
  return rc;
}








<
<
<
<
<







337
338
339
340
341
342
343





344
345
346
347
348
349
350
  zFN = mprintf("%s", zFilename);
  file_simplify_name(zFN, -1, 0);
  rc = getStat(zFN, eFType);
  if( rc ){
    rc = 0; /* It does not exist at all. */
  }else if( S_ISDIR(fx.fileStat.st_mode) ){
    rc = 1; /* It exists and is a real directory. */





  }else{
    rc = 2; /* It exists and is something else. */
  }
  free(zFN);
  return rc;
}