Fossil

Check-in [9595cfcd]
Login

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

Overview
Comment:Pass the command flags into the TH1 hooks verbatim, without any masking.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:9595cfcd456c953d2a45956a607f7587d9c63e3a
User & Date: mistachkin 2016-09-13 22:13:24
Context
2016-09-13
22:14
Add '--no-prompt' option to the 'commit' command. check-in: 29ef4f5d user: mistachkin tags: trunk
22:13
Pass the command flags into the TH1 hooks verbatim, without any masking. check-in: 9595cfcd user: mistachkin tags: trunk
22:12
Update custom MinGW makefile. check-in: b218dbb9 user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/dispatch.c.

    44     44   #define CMDFLAG_1ST_TIER  0x0001      /* Most important commands */
    45     45   #define CMDFLAG_2ND_TIER  0x0002      /* Obscure and seldom used commands */
    46     46   #define CMDFLAG_TEST      0x0004      /* Commands for testing only */
    47     47   #define CMDFLAG_WEBPAGE   0x0008      /* Web pages */
    48     48   #define CMDFLAG_COMMAND   0x0010      /* A command */
    49     49   /**************************************************************************/
    50     50   
    51         -/* Only the bits above that are part of CMDFLAG_TH_MASK are passed into
    52         -** the TH1 hook procedures. */
    53         -#define CMDFLAG_TH_MASK   0x000f      /* Legacy flags only */
    54         -
    55     51   /* Values for the 2nd parameter to dispatch_name_search() */
    56     52   #define CMDFLAG_ANY       0x0018      /* Match anything */
    57     53   #define CMDFLAG_PREFIX    0x0020      /* Prefix match is ok */
    58     54   
    59     55   #endif /* INTERFACE */
    60     56   
    61     57   /*

Changes to src/main.c.

   729    729     ** TH_RETURN: The xFunc() will be executed, the TH1 notification will be
   730    730     **            skipped.
   731    731     **
   732    732     ** TH_CONTINUE: The xFunc() will be skipped, the TH1 notification will be
   733    733     **              executed.
   734    734     */
   735    735     if( !g.isHTTP && !g.fNoThHook ){
   736         -    rc = Th_CommandHook(pCmd->zName, pCmd->eCmdFlags & CMDFLAG_TH_MASK);
          736  +    rc = Th_CommandHook(pCmd->zName, pCmd->eCmdFlags);
   737    737     }else{
   738    738       rc = TH_OK;
   739    739     }
   740    740     if( rc==TH_OK || rc==TH_RETURN || rc==TH_CONTINUE ){
   741    741       if( rc==TH_OK || rc==TH_RETURN ){
   742    742   #endif
   743    743         pCmd->xFunc();
   744    744   #ifdef FOSSIL_ENABLE_TH1_HOOKS
   745    745       }
   746    746       if( !g.isHTTP && !g.fNoThHook && (rc==TH_OK || rc==TH_CONTINUE) ){
   747         -      Th_CommandNotify(pCmd->zName, pCmd->eCmdFlags & CMDFLAG_TH_MASK);
          747  +      Th_CommandNotify(pCmd->zName, pCmd->eCmdFlags);
   748    748       }
   749    749     }
   750    750   #endif
   751    751     fossil_exit(0);
   752    752     /*NOT_REACHED*/
   753    753     return 0;
   754    754   }
................................................................................
  1544   1544       **            skipped.
  1545   1545       **
  1546   1546       ** TH_CONTINUE: The xFunc() will be skipped, the TH1 notification will be
  1547   1547       **              executed.
  1548   1548       */
  1549   1549       int rc;
  1550   1550       if( !g.fNoThHook ){
  1551         -      rc = Th_WebpageHook(pCmd->zName+1, pCmd->eCmdFlags & CMDFLAG_TH_MASK);
         1551  +      rc = Th_WebpageHook(pCmd->zName+1, pCmd->eCmdFlags);
  1552   1552       }else{
  1553   1553         rc = TH_OK;
  1554   1554       }
  1555   1555       if( rc==TH_OK || rc==TH_RETURN || rc==TH_CONTINUE ){
  1556   1556         if( rc==TH_OK || rc==TH_RETURN ){
  1557   1557   #endif
  1558   1558           pCmd->xFunc();
  1559   1559   #ifdef FOSSIL_ENABLE_TH1_HOOKS
  1560   1560         }
  1561   1561         if( !g.fNoThHook && (rc==TH_OK || rc==TH_CONTINUE) ){
  1562         -        Th_WebpageNotify(pCmd->zName+1, pCmd->eCmdFlags & CMDFLAG_TH_MASK);
         1562  +        Th_WebpageNotify(pCmd->zName+1, pCmd->eCmdFlags);
  1563   1563         }
  1564   1564       }
  1565   1565   #endif
  1566   1566     }
  1567   1567   
  1568   1568     /* Return the result.
  1569   1569     */