Fossil

Check-in [09cf1ad8]
Login

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

Overview
Comment:Fix the backslash-octal escapes on the filename quoting while importing from git.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 09cf1ad8eecf502c225ff5711e50fe865f3ef920
User & Date: drh 2015-11-29 17:33:05
Context
2015-11-30
00:23
Remove extra colon and space in section topics in style guidelines. check-in: 069084af user: andybradford tags: trunk
2015-11-29
17:33
Fix the backslash-octal escapes on the filename quoting while importing from git. check-in: 09cf1ad8 user: drh tags: trunk
03:51
Fix incorrect form generation for zip pages from redirected anonymous login. This only happens when the zip permission is only allowed after anonymous login is successful. check-in: 167dec48 user: andybradford tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/import.c.

461
462
463
464
465
466
467











468


469
470
471
472
473
474
475
static void dequote_git_filename(char *zName){
  int n, i, j;
  if( zName==0 || zName[0]!='"' ) return;
  n = (int)strlen(zName);
  if( zName[n-1]!='"' ) return;
  for(i=0, j=1; j<n-1; j++){
    char c = zName[j];











    if( c=='\\' ) c = zName[++j];


    zName[i++] = c;
  }
  zName[i] = 0;
}


/*







>
>
>
>
>
>
>
>
>
>
>
|
>
>







461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
static void dequote_git_filename(char *zName){
  int n, i, j;
  if( zName==0 || zName[0]!='"' ) return;
  n = (int)strlen(zName);
  if( zName[n-1]!='"' ) return;
  for(i=0, j=1; j<n-1; j++){
    char c = zName[j];
    int x;
    if( c=='\\' ){
      if( j+3 <= n-1
       && zName[j+1]>='0' && zName[j+1]<='3'
       && zName[j+2]>='0' && zName[j+2]<='7'
       && zName[j+3]>='0' && zName[j+3]<='7'
       && (x = 64*(zName[j+1]-'0') + 8*(zName[j+2]-'0') + zName[j+3]-'0')!=0
      ){
        c = (unsigned char)x;
        j += 3;
      }else{
        c = zName[++j];
      }
    }
    zName[i++] = c;
  }
  zName[i] = 0;
}


/*