diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 0a4e8234d4..0a6fdd43c0 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -87,9 +87,9 @@ 2000-04-11 14:30 GMT-4 David G. Holm * config/w32/gcc.cf - + Added LNK_USR_PATH and LNK_USR_LIB environment variables to specify - non-Harbour libraries. Put one or more paths in LNK_USR_PATH and one - or more base library names in LNK_USR_LIB, using spaces to separate. + + Added LNK_USR_PATH and LNK_USR_LIB environment variables to specify + non-Harbour libraries. Put one or more paths in LNK_USR_PATH and one + or more base library names in LNK_USR_LIB, using spaces to separate. * tests/inkeytst.prg % Modularization and display improvements by diff --git a/harbour/config/w32/bcc32.cf b/harbour/config/w32/bcc32.cf index 3a6540e5e2..dff3844cd2 100644 --- a/harbour/config/w32/bcc32.cf +++ b/harbour/config/w32/bcc32.cf @@ -61,6 +61,16 @@ ifneq ($(HB_SCREEN_LIB),) LINKLIBS += $(HB_SCREEN_LIB) endif +# Add the optional user path(s) +ifneq ($(LNK_USR_PATH),) +LINKPATHS += $(foreach path, $(LNK_USR_PATH), -L$(path)) +endif + +# Add the optional user libarary (or libraries) +ifneq ($(LNK_USR_LIB),) +LINKLIBS += $(foreach lib, $(LNK_USR_LIB), $(lib)$(LIB_EXT)) +endif + LDFLAGS = $(LINKPATHS) AR = tlib diff --git a/harbour/source/rtl/dateshb.c b/harbour/source/rtl/dateshb.c index f295d113ab..43262cd4a1 100644 --- a/harbour/source/rtl/dateshb.c +++ b/harbour/source/rtl/dateshb.c @@ -81,7 +81,7 @@ HB_FUNC( CTOD ) if( szDate ) { int d_pos = 0, m_pos = 0, y_pos = 0; - int count, digit, size = strlen( hb_set.HB_SET_DATEFORMAT ); + int count, digit, non_digit, size = strlen( hb_set.HB_SET_DATEFORMAT ); for( count = 0; count < size; count++ ) { @@ -116,25 +116,36 @@ HB_FUNC( CTOD ) } } + /* If there are non-digits at the start of the date field, + they are not to be treated as date field separators */ + non_digit = 1; size = strlen( szDate ); - for( count = 0; count < size; count++ ) { digit = szDate[ count ]; if( isdigit( digit ) ) { + /* Process the digit for the current date field */ if( d_pos == 1 ) d_value = ( d_value * 10 ) + digit - '0'; else if( m_pos == 1 ) m_value = ( m_value * 10 ) + digit - '0'; else if( y_pos == 1 ) y_value = ( y_value * 10 ) + digit - '0'; + /* Treat the next non-digit as a date field separator */ + non_digit = 0; } else if( digit != ' ' ) { - d_pos--; - m_pos--; - y_pos--; + /* Process the non-digit */ + if( non_digit++ == 0 ) + { + /* Only move to the next date field on the first + consecutive non-digit that is encountered */ + d_pos--; + m_pos--; + y_pos--; + } } }