Fossil

Check-in [74c4732fd2]
Login

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

Overview
Comment:Fix the file_mkfolder() function so that it works for files in the root directory.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 74c4732fd2a040ca8ed7efae85f13cbf43d032f178bae4ada3c11fd5086bebfc
User & Date: drh 2020-09-15 12:59:34.613
Context
2020-09-15
13:24
Include pikchr source text in the generated SVG. check-in: 041390d3f8 user: drh tags: trunk
12:59
Fix the file_mkfolder() function so that it works for files in the root directory. check-in: 74c4732fd2 user: drh tags: trunk
07:51
Consolidate pikchrshow page/pikchr command use of pikchr()/th1 into a shared routine. Though /pikchrshow does not currently allow th1-processed scripts, it might be interesting to enable for users with edit/checkin (or admin) rights. check-in: 893bf2a146 user: stephan tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/file.c.
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
  int nName, rc = 0;
  char *zName;

  nName = strlen(zFilename);
  zName = mprintf("%s", zFilename);
  nName = file_simplify_name(zName, nName, 0);
  while( nName>0 && zName[nName-1]!='/' ){ nName--; }
  if( nName ){
    zName[nName-1] = 0;
    if( file_isdir(zName, eFType)!=1 ){
      rc = file_mkfolder(zName, eFType, forceFlag, errorReturn);
      if( rc==0 ){
        if( file_mkdir(zName, eFType, forceFlag)
         && file_isdir(zName, eFType)!=1
        ){







|







798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
  int nName, rc = 0;
  char *zName;

  nName = strlen(zFilename);
  zName = mprintf("%s", zFilename);
  nName = file_simplify_name(zName, nName, 0);
  while( nName>0 && zName[nName-1]!='/' ){ nName--; }
  if( nName>1 ){
    zName[nName-1] = 0;
    if( file_isdir(zName, eFType)!=1 ){
      rc = file_mkfolder(zName, eFType, forceFlag, errorReturn);
      if( rc==0 ){
        if( file_mkdir(zName, eFType, forceFlag)
         && file_isdir(zName, eFType)!=1
        ){