Fossil

Check-in [ffd5e09e]
Login

Check-in [ffd5e09e]

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

Overview
Comment:Use strncmp() instead of memcmp().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | httpsBaseUrl
Files: files | file ages | folders
SHA1: ffd5e09ec7ec237374919f340c5559c7d024d499
User & Date: mistachkin 2016-02-01 20:22:30.269
Context
2016-02-01
20:36
The 'g.zHttpsURL' variable should be populated even when the --baseurl option is used. ... (check-in: 4110f522 user: mistachkin tags: trunk)
20:22
Use strncmp() instead of memcmp(). ... (Closed-Leaf check-in: ffd5e09e user: mistachkin tags: httpsBaseUrl)
04:11
Comment fix. ... (check-in: c3a17f81 user: mistachkin tags: httpsBaseUrl)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/main.c.
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
  const char *zMode;
  const char *zCur;

  if( g.zBaseURL!=0 ) return;
  if( zAltBase ){
    int i, n, c;
    g.zTop = g.zBaseURL = mprintf("%s", zAltBase);
    if( memcmp(g.zTop, "http://", 7)==0 ){
      /* it is HTTP, replace prefix with HTTPS. */
      g.zHttpsURL = mprintf("https://%s", &g.zTop[7]);
    }else if( memcmp(g.zTop,"https://",8)==0 ){
      /* it is already HTTPS, use it. */
      g.zHttpsURL = mprintf("%s", g.zTop);
    }else{
      fossil_fatal("argument to --baseurl should be 'http://host/path'"
                   " or 'https://host/path'");
    }
    for(i=n=0; (c = g.zTop[i])!=0; i++){







|


|







1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
  const char *zMode;
  const char *zCur;

  if( g.zBaseURL!=0 ) return;
  if( zAltBase ){
    int i, n, c;
    g.zTop = g.zBaseURL = mprintf("%s", zAltBase);
    if( strncmp(g.zTop, "http://", 7)==0 ){
      /* it is HTTP, replace prefix with HTTPS. */
      g.zHttpsURL = mprintf("https://%s", &g.zTop[7]);
    }else if( strncmp(g.zTop, "https://", 8)==0 ){
      /* it is already HTTPS, use it. */
      g.zHttpsURL = mprintf("%s", g.zTop);
    }else{
      fossil_fatal("argument to --baseurl should be 'http://host/path'"
                   " or 'https://host/path'");
    }
    for(i=n=0; (c = g.zTop[i])!=0; i++){