Fossil

Check-in [6cb7a7e28d]
Login

Check-in [6cb7a7e28d]

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

Overview
Comment:Fix a logic error in processing of the FOSSIL_COLOR environment variable.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | standard-cli-colors
Files: files | file ages | folders
SHA3-256: 6cb7a7e28dfd13afd904710111c29d105ff8f2168a2b76c27cf722543f95050d
User & Date: florian 2025-04-19 04:20:00.000
Context
2025-04-25
16:18
Sync with trunk. ... (check-in: 855076ce79 user: florian tags: standard-cli-colors)
2025-04-19
04:20
Fix a logic error in processing of the FOSSIL_COLOR environment variable. ... (check-in: 6cb7a7e28d user: florian tags: standard-cli-colors)
2025-04-18
07:20
Remove documentation of the --highlight option for the search command. The option was broken, anyway, and is now superseded by the global --color option and the FOSSIL_COLOR environment variable. ... (check-in: 5331dfed41 user: florian tags: standard-cli-colors)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/main.c.
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
      }
      fossil_path_free(zEnvVar);
    }
  }
  g.cliColor = "\033[91m";
  zEnvVar = fossil_getenv("FOSSIL_COLOR");
  if( zEnvVar ){
    if( fossil_strcmp(zEnvVar,"none")==0 &&
        g.colorOutput==COLOR_VT_UNSET ){
      g.colorOutput = COLOR_VT_NEVER;
    }else{
      int i, fValid = 1;
      /* Rudimentary sanity check: only allow digits and semicolon. */
      for( i=0; zEnvVar[i]; i++ ){
        if( !strchr("0123456789;",zEnvVar[i]) ) fValid = 0;
      }
      if( fValid ) g.cliColor = mprintf("\033[%sm",zEnvVar);







|
|
<







687
688
689
690
691
692
693
694
695

696
697
698
699
700
701
702
      }
      fossil_path_free(zEnvVar);
    }
  }
  g.cliColor = "\033[91m";
  zEnvVar = fossil_getenv("FOSSIL_COLOR");
  if( zEnvVar ){
    if( fossil_strcmp(zEnvVar,"none")==0 ){
      if( g.colorOutput==COLOR_VT_UNSET ) g.colorOutput = COLOR_VT_NEVER;

    }else{
      int i, fValid = 1;
      /* Rudimentary sanity check: only allow digits and semicolon. */
      for( i=0; zEnvVar[i]; i++ ){
        if( !strchr("0123456789;",zEnvVar[i]) ) fValid = 0;
      }
      if( fValid ) g.cliColor = mprintf("\033[%sm",zEnvVar);