Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Optimized validation 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: |
c5f1e0daea483f3cd9d19552e8910641 |
| User & Date: | florian 2025-04-25 16:22:00.000 |
Context
|
2025-07-21
| ||
| 12:23 | Sync with trunk. ... (check-in: e17d35e796 user: florian tags: standard-cli-colors) | |
|
2025-04-25
| ||
| 16:22 | Optimized validation of the FOSSIL_COLOR environment variable. ... (check-in: c5f1e0daea user: florian tags: standard-cli-colors) | |
| 16:19 | Fix a logic error in processing of the NO_COLOR environment variable. ... (check-in: fbfa6daeca user: florian tags: standard-cli-colors) | |
Changes
Changes to src/main.c.
| ︙ | ︙ | |||
693 694 695 696 697 698 699 |
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++ ){
| | > > > | 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 |
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;
break;
}
}
if( fValid ) g.cliColor = mprintf("\033[%sm",zEnvVar);
}
fossil_path_free(zEnvVar);
}
}
|
| ︙ | ︙ |