allow changing of the timestamp char code delimeter (#1972)

This commit is contained in:
Andrew Bauer 2017-08-21 10:27:11 -05:00 committed by Isaac Connor
parent 431ec3ea75
commit ac5d1738ea
2 changed files with 20 additions and 1 deletions

View File

@ -700,6 +700,25 @@ our @options = (
type => $types{boolean},
category => 'config',
},
{
name => 'ZM_TIMESTAMP_CODE_CHAR',
default => '%',
description => 'Character to used to identify timestamp codes',
help => q`
There are a few codes one can use to tell ZoneMinder to insert
data into the timestamp of each image. Traditionally, the
percent (%) character has been used to identify these codes since
the current character codes do not conflict with the strftime
codes, which can also be used in the timestamp. While this works
well for Linux, this does not work well for BSD operating systems.
Changing the default character to something else, such as an
exclamation point (!), resolves the issue. Note this only affects
the timestamp codes built into ZoneMinder. It has no effect on
the family of strftime codes one can use.
`,
type => $types{string},
category => 'config',
},
{
name => 'ZM_CPU_EXTENSIONS',
default => 'yes',

View File

@ -2941,7 +2941,7 @@ void Monitor::TimestampImage( Image *ts_image, const struct timeval *ts_time ) c
const char *s_ptr = label_time_text;
char *d_ptr = label_text;
while ( *s_ptr && ((d_ptr-label_text) < (unsigned int)sizeof(label_text)) ) {
if ( *s_ptr == '%' ) {
if ( *s_ptr == config.timestamp_code_char[0] ) {
bool found_macro = false;
switch ( *(s_ptr+1) ) {
case 'N' :