diff -r -N --context ../SteelBlue-2.1b1/LICENSE.TXT ./LICENSE.TXT *** ../SteelBlue-2.1b1/LICENSE.TXT Mon Jun 26 17:27:34 2000 --- ./LICENSE.TXT Tue Feb 13 14:07:31 2001 *************** *** 1,111 **** ! SteelBlue License (SBL) - Non-Recourse, Non-Exclusive Revocable License Agreement ! The attached software application ("Program") is owned exclusively by ! Turner Consulting Group, Inc. ("TCG"), a Maryland corporation, and is ! protected by United States copyright law and international treaty. ! The right to use the Program for any and all purposes is subject to, ! and by downloading, installing and/or using this software you ! (sometimes referred to as "User") accept all of the terms and ! conditions set forth below. The term "Program" shall include all ! portions thereof, all versions, releases, upgrades, enhancements, ! improvements, modifications, updates and all derivatives, as ! determined by TCG to be part of the Program. Nothing herein shall be ! construed as an offer by TCG to supply any such additional materials ! or services, or restrict TCG's sale or licensing to others of products ! based upon the Program in whole or in part. ! ! 1. LICENSE. The Program is provided or made available to User by TCG ! on an open source and non-exclusive basis. The Program and any ! and all rights therein, may not be sold, transferred, sublicensed, ! distributed or otherwise conveyed by you in any manner for any ! reason, other than in compliance with the terms of this License. ! ! 2. COPIES AND DISTRIBUTION. The Program may be copied and installed ! on an unlimited number of User's workstations, networks and ! information systems. The Program, in whole or in part, may be ! distributed by User to others, provided that distribution ! ! (i) permits and enables further distribution; and ! ! (ii) in every instance be accompanied by this License. All users ! and recipients shall remain subject to the terms and ! conditions hereof. ! ! 3. RESTRICTIONS. Except in compliance with this License, the Program ! may not be distributed, published, sublicensed or otherwise ! disseminated or exploited by User or any other person or entity ! without the prior written consent of TCG in each instance. All ! use of the Program, and all copies, correspondence, publications ! and other materials used therewith, shall indicate in a prominent ! manner that the Program is subject to this License and the rights ! of TCG, and shall be accompanied by the restrictions set forth ! herein. The grant of the license of the Program does not include ! the conveyance by TCG of any ownership right, title or other ! interest. ! ! 4. MODIFICATIONS. Modifications of the Program may be made and ! distributed only under the following conditions: ! ! a. Modifications may not alter or remove any copyright notices in ! the Program with respect to TCG. ! ! b. All distributed modifications to the Program shall immediately ! become subject to a permanent non-exclusive royalty-free right ! hereby granted to TCG to include such modifications in the ! Program as it may determine from time to time, and the ! unrestricted right to distribute such modification in all future ! versions of the Program, without obligation to User of any kind. ! ! c. Upon distribution, the source code of all modifications to the ! Program must be made available free of charge to TCG as ! specified on the Web page at ! http://www.steelblue.com/modifications/ . ! ! 5. TERMINATION. In the event of any default or failure of User to ! abide by the terms hereof, this license may be revoked by TCG ! without prior notice and all rights granted hereunder rescinded. ! In the event of such revocation, the Program and all copies ! thereof however stored and on all media, temporary and permanent, ! shall be returned to TCG or destroyed or otherwise disabled by ! User. Upon request User shall provide sufficient evidence of ! compliance said obligation. ! ! 6. COPYRIGHT. All right, title and interest in and to the Program, ! including but not limited to the copyright and the right to sell, ! transfer, license or otherwise convey the Program and any rights ! therein, remain exclusively with TCG. The license granted ! hereunder does not include the right to use the name "TCG" or any ! trademark, servicemark, ownership right, copyright or other ! property of TCG in any manner. ! ! 7. WARRANTY. THE PROGRAM IS PROVIDED BY TCG ON AN "AS IS" BASIS. ! TCG MAKES AND EXTENDS NO WARRANTIES OR GUARANTEES OF ANY KIND, ! EXPRESS OR IMPLIED, WITH REGARD TO THE PROGRAM, ITS OPERATION, ! COMPATIBILITY, USE OR ANY OTHER BENEFIT OR FEATURE IN ANY MANNER, ! OR THE DOCUMENTATION PROVIDED THEREWITH. ALL RISK OF USE IS ! ASSUMED BY USER. TCG MAKES NO WARRANTY OF ANY KIND WITH REGARD TO ! MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, DESTRUCTIVE ! CODE, CALENDAR COMPATIBILITY, OR WITH REGARD TO ANY RIGHTS OR ! INFRINGEMENT OF ANY RIGHTS THAT MAY BE ASSERTED BY OTHERS. IN NO ! EVENT SHALL TCG BE RESPONSIBLE FOR ANY DAMAGES OF ANY KIND THAT ! MAY ARISE IN CONNECTION WITH THE LICENSE, USE, INSTALLATION, ! OPERATION, STORAGE OR OTHER FUNCTION OF THE PROGRAM, INCLUDING BUT ! NOT LIMITED TO ACTUAL, SPECIAL OR CONSEQUENTIAL DAMAGES, LOSS OR ! DESTRUCTION OF DATA OR SYSTEMS, BUSINESS INTERRUPTION, LOSS OF ! REVENUE OR PROFIT, LOSS OF OPPORTUNITY, OR ANY OTHER MONETARY OR ! NON-MONETARY LOSS, NOTWITHSTANDING THAT INFORMATION REGARDING THE ! POSSIBILITY OF SUCH LOSS MAY HAVE BEEN PROVIDED AT ANY TIME TO ! TCG, ITS AGENTS OR EMPLOYEES. IN NO EVENT SHALL TCG'S LIABILITY ! EXCEED THE PURCHASE PRICE PAID BY USER TO TCG FOR THE LICENSE ! HEREIN GRANTED. ! ! 8. GOVERNING LAW. This license shall be governed under the laws of ! the State of Maryland, the courts of which state shall have sole ! jurisdiction, and shall be the sole venue, of all actions that may ! arise hereunder. ! ! 9. This license is hereby made open-source. Copy it and use it in ! other products. Knock yourself out (though TCG will not be ! responsible for any damage caused by your knocking yourself out). --- 1,123 ---- ! The copyright for SteelBlue is held by the Turner Consulting Group ! (http://www.tcg-inc.com/). Copyright (C) 2001. ! The "Artistic License" ! ! Preamble ! ! The intent of this document is to state the conditions under which a ! Package may be copied, such that the Copyright Holder maintains some ! semblance of artistic control over the development of the package, ! while giving the users of the package the right to use and distribute ! the Package in a more-or-less customary fashion, plus the right to ! make reasonable modifications. ! ! Definitions: ! ! "Package" refers to the collection of files distributed by the ! Copyright Holder, and derivatives of that collection of files created ! through textual modification. ! ! "Standard Version" refers to such a Package if it has not been ! modified, or has been modified in accordance with the wishes of the ! Copyright Holder. ! ! "Copyright Holder" is whoever is named in the copyright or copyrights ! for the package. ! ! "You" is you, if you're thinking about copying or distributing this ! Package. ! ! "Reasonable copying fee" is whatever you can justify on the basis of ! media cost, duplication charges, time of people involved, and so ! on. (You will not be required to justify it to the Copyright Holder, ! but only to the computing community at large as a market that must ! bear the fee.) ! ! "Freely Available" means that no fee is charged for the item itself, ! though there may be fees involved in handling the item. It also means ! that recipients of the item may redistribute it under the same ! conditions they received it. ! ! 1. You may make and give away verbatim copies of the source form of ! the Standard Version of this Package without restriction, provided ! that you duplicate all of the original copyright notices and ! associated disclaimers. ! ! 2. You may apply bug fixes, portability fixes and other modifications ! derived from the Public Domain or from the Copyright Holder. A ! Package modified in such a way shall still be considered the ! Standard Version. ! ! 3. You may otherwise modify your copy of this Package in any way, ! provided that you insert a prominent notice in each changed file ! stating how and when you changed that file, and provided that you ! do at least ONE of the following: ! ! ! a) place your modifications in the Public Domain or otherwise make ! them Freely Available, such as by posting said modifications to ! Usenet or an equivalent medium, or placing the modifications on ! a major archive site such as ftp.uu.net, or by allowing the ! Copyright Holder to include your modifications in the Standard ! Version of the Package. ! ! b) use the modified Package only within your corporation or ! organization. ! ! c) rename any non-standard executables so the names do not conflict ! with standard executables, which must also be provided, and ! provide a separate manual page for each non-standard executable ! that clearly documents how it differs from the Standard Version. ! ! d) make other distribution arrangements with the Copyright Holder. ! ! ! 4. You may distribute the programs of this Package in object code or ! executable form, provided that you do at least ONE of the ! following: ! ! a) distribute a Standard Version of the executables and library ! files, together with instructions (in the manual page or ! equivalent) on where to get the Standard Version. ! ! b) accompany the distribution with the machine-readable source of ! the Package with your modifications. ! ! c) accompany any non-standard executables with their corresponding ! Standard Version executables, giving the non-standard ! executables non-standard names, and clearly documenting the ! differences in manual pages (or equivalent), together with ! instructions on where to get the Standard Version. ! ! d) make other distribution arrangements with the Copyright Holder. ! ! ! 5. You may charge a reasonable copying fee for any distribution of ! this Package. You may charge any fee you choose for support of this ! Package. You may not charge a fee for this Package itself. However, ! you may distribute this Package in aggregate with other (possibly ! commercial) programs as part of a larger (possibly commercial) ! software distribution provided that you do not advertise this ! Package as a product of your own. ! ! 6. The scripts and library files supplied as input to or produced as ! output from the programs of this Package do not automatically fall ! under the copyright of this Package, but belong to whomever ! generated them, and may be sold commercially, and may be aggregated ! with this Package. ! ! 7. C or perl subroutines supplied by you and linked into this Package ! shall not be considered part of this Package. ! ! 8. The name of the Copyright Holder may not be used to endorse or ! promote products derived from this software without specific prior ! written permission. ! ! 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED ! WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES ! OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! ! ! The End diff -r -N --context ../SteelBlue-2.1b1/src/Makefile ./src/Makefile *** ../SteelBlue-2.1b1/src/Makefile Tue Dec 19 15:46:28 2000 --- ./src/Makefile Tue Feb 13 14:11:02 2001 *************** *** 50,55 **** --- 50,58 ---- all: config.mk steelblue.bin + # Needed for RPM builds + steelblue: steelblue.bin + config.mk: # # WARNING: copying config.mk.sample to config.mk diff -r -N --context ../SteelBlue-2.1b1/src/install/SteelBlue_2.0b1_mysql.spec ./src/install/SteelBlue_2.0b1_mysql.spec *** ../SteelBlue-2.1b1/src/install/SteelBlue_2.0b1_mysql.spec Tue Jan 18 10:03:32 2000 --- ./src/install/SteelBlue_2.0b1_mysql.spec Wed Dec 31 19:00:00 1969 *************** *** 1,40 **** - Summary: The SteelBlue appserver install for MySQL - Name: SteelBlue - Version: 2.0b1 - Release: mysql_1 - Vendor: Turner Consulting Group - Copyright: commercial - Group: Application/Internet - Requires: MySQL - URL: http://www.steelblue.com/ - Packager: Robert Buccigrossi - Prefix: /opt - Source: SteelBlue_2.0b1.tar.gz - patch0: SteelBlue_2.0b1_mysql.patch - %description - A Web application server designed to integrate relational database - access, security, complex business rules, and HTML. - - This particular install creates a mySQL SteelBlue installation in - /opt/steelblue. - - %prep - %setup - %patch - - %build - cd src - make steelblue - - %install - cd src - make install - make docs - - %post - - %postun - - %files - %doc doc examples schema INSTALL.TXT LICENSE.TXT - /opt/steelblue --- 0 ---- diff -r -N --context ../SteelBlue-2.1b1/src/install/SteelBlue_2.0b1_mysql_auto.spec ./src/install/SteelBlue_2.0b1_mysql_auto.spec *** ../SteelBlue-2.1b1/src/install/SteelBlue_2.0b1_mysql_auto.spec Tue Jan 18 10:03:32 2000 --- ./src/install/SteelBlue_2.0b1_mysql_auto.spec Wed Dec 31 19:00:00 1969 *************** *** 1,84 **** - Summary: The SteelBlue appserver install for MySQL - Name: SteelBlue - Version: 2.0b1 - Release: mysql_auto_1 - Vendor: Turner Consulting Group - Copyright: commercial - Group: Application/Internet - Requires: MySQL - URL: http://www.steelblue.com/ - Packager: Robert Buccigrossi - Prefix: /opt - Source: SteelBlue_2.0b1.tar.gz - patch0: SteelBlue_2.0b1_mysql_auto.patch - %description - A Web application server designed to integrate relational database - access, security, complex business rules, and HTML. - - This particular install creates a mySQL DB "STEELBLUE" and installs - the executable to the default Apache cgi-bin and html directories - as well as in /opt/steelblue. - - For installation, the environment variables OWNER, GROUP, CGI_BIN, - and HTDOCS_DIR can be set to override the defaults. - - For uninstallation, the environment variables CGI_BIN, HTDOCS_DIR, - and NO_REMOVE_DB can be set to override the defaults. By default - the STEELBLUE database is removed. The database can be kept by - setting NO_REMOVE_DB to a non-empty value. - - %prep - %setup - %patch - - %build - cd src - make steelblue - make docs - - %install - cd src - make install - - %post - PATH=${PATH}:/usr/bin:/usr/local/bin - OWNER=${OWNER:-"nobody"} - GROUP=${GROUP:-"nobody"} - CGI_BIN=${CGI_BIN:-"/home/httpd/cgi-bin/"} - HTDOCS_DIR=${HTDOCS_DIR:-"/home/httpd/html/"} - - if (! test -d $CGI_BIN); then - echo "CGI_BIN ($CGI_BIN) is an invalid directory" - exit 1 - fi; - - if (! test -d $HTDOCS_DIR); then - echo "HTDOCS_DIR ($HTDOCS_DIR) is an invalid directory" - exit 1 - fi; - - install -v -s --mode=755 --group=$GROUP --owner=$OWNER /opt/steelblue/steelblue $CGI_BIN - install -v --mode=755 --group=$GROUP --owner=$OWNER /opt/steelblue/steelblue.conf $CGI_BIN - install -v -d --mode=755 --group=$GROUP --owner=$OWNER $HTDOCS_DIR/scripts - install -v --mode=444 --group=$GROUP --owner=$OWNER /opt/steelblue/CheckUtils.js $HTDOCS_DIR/scripts - - mysqladmin create STEELBLUE - /usr/bin/mysql -u root STEELBLUE < /usr/doc/SteelBlue-2.0b1/schema/mySQL.schema.sql - - %postun - PATH=${PATH}:/usr/bin:/usr/local/bin - CGI_BIN=${CGI_BIN:-"/home/httpd/cgi-bin/"} - HTDOCS_DIR=${HTDOCS_DIR:-"/home/httpd/html/"} - - rm -f $CGI_BIN/steelblue - rm -f $CGI_BIN/steelblue.conf - rm -f $HTDOCS_DIR/scripts/CheckUtils.js - rmdir $HTDOCS_DIR/scripts - - if (! test $NO_REMOVE_DB); then - /usr/bin/mysqladmin -f drop STEELBLUE - fi - - %files - %doc doc examples schema INSTALL.TXT LICENSE.TXT - /opt/steelblue --- 0 ---- diff -r -N --context ../SteelBlue-2.1b1/src/install/SteelBlue_2.0b1_psql.spec ./src/install/SteelBlue_2.0b1_psql.spec *** ../SteelBlue-2.1b1/src/install/SteelBlue_2.0b1_psql.spec Tue Jan 18 11:30:36 2000 --- ./src/install/SteelBlue_2.0b1_psql.spec Wed Dec 31 19:00:00 1969 *************** *** 1,40 **** - Summary: The SteelBlue appserver install for Postgres - Name: SteelBlue - Version: 2.0b1 - Release: psql_1 - Vendor: Turner Consulting Group - Copyright: commercial - Group: Application/Internet - Requires: postgresql - URL: http://www.steelblue.com/ - Packager: Robert Buccigrossi - Prefix: /opt - Source: SteelBlue_2.0b1.tar.gz - patch0: SteelBlue_2.0b1_psql.patch - %description - A Web application server designed to integrate relational database - access, security, complex business rules, and HTML. - - This particular install creates a Postgres SteelBlue installation in - /opt/steelblue. - - %prep - %setup - %patch - - %build - cd src - make steelblue - - %install - cd src - make install - make docs - - %post - - %postun - - %files - %doc doc examples schema INSTALL.TXT LICENSE.TXT - /opt/steelblue --- 0 ---- diff -r -N --context ../SteelBlue-2.1b1/src/install/SteelBlue_mysql.spec ./src/install/SteelBlue_mysql.spec *** ../SteelBlue-2.1b1/src/install/SteelBlue_mysql.spec Sun Feb 4 23:44:22 2001 --- ./src/install/SteelBlue_mysql.spec Sat Feb 17 18:19:48 2001 *************** *** 1,6 **** Summary: The SteelBlue appserver install for MySQL Name: SteelBlue ! Version: 2.1b1 Release: mysql_1 Vendor: Turner Consulting Group Copyright: commercial --- 1,6 ---- Summary: The SteelBlue appserver install for MySQL Name: SteelBlue ! Version: 2.1b2 Release: mysql_1 Vendor: Turner Consulting Group Copyright: commercial *************** *** 9,15 **** URL: http://www.steelblue.com/ Packager: Robert Buccigrossi Prefix: /opt ! Source: SteelBlue_2.1b1.tar.gz patch0: SteelBlue_mysql.patch %description A Web application server designed to integrate relational database --- 9,15 ---- URL: http://www.steelblue.com/ Packager: Robert Buccigrossi Prefix: /opt ! Source: SteelBlue_2.1b2.tar.gz patch0: SteelBlue_mysql.patch %description A Web application server designed to integrate relational database diff -r -N --context ../SteelBlue-2.1b1/src/install/SteelBlue_mysql_auto.spec ./src/install/SteelBlue_mysql_auto.spec *** ../SteelBlue-2.1b1/src/install/SteelBlue_mysql_auto.spec Sun Feb 4 23:44:22 2001 --- ./src/install/SteelBlue_mysql_auto.spec Sat Feb 17 18:19:48 2001 *************** *** 1,6 **** Summary: The SteelBlue appserver install for MySQL Name: SteelBlue ! Version: 2.1b1 Release: mysql_auto_1 Vendor: Turner Consulting Group Copyright: commercial --- 1,6 ---- Summary: The SteelBlue appserver install for MySQL Name: SteelBlue ! Version: 2.1b2 Release: mysql_auto_1 Vendor: Turner Consulting Group Copyright: commercial *************** *** 9,15 **** URL: http://www.steelblue.com/ Packager: Robert Buccigrossi Prefix: /opt ! Source: SteelBlue_2.1b1.tar.gz patch0: SteelBlue_mysql_auto.patch %description A Web application server designed to integrate relational database --- 9,15 ---- URL: http://www.steelblue.com/ Packager: Robert Buccigrossi Prefix: /opt ! Source: SteelBlue_2.1b2.tar.gz patch0: SteelBlue_mysql_auto.patch %description A Web application server designed to integrate relational database *************** *** 63,69 **** install -v --mode=444 --group=$GROUP --owner=$OWNER /opt/steelblue/CheckUtils.js $HTDOCS_DIR/scripts mysqladmin create STEELBLUE ! /usr/bin/mysql -u root STEELBLUE < /usr/doc/SteelBlue-2.1b1/schema/mySQL.schema.sql %postun PATH=${PATH}:/usr/bin:/usr/local/bin --- 63,69 ---- install -v --mode=444 --group=$GROUP --owner=$OWNER /opt/steelblue/CheckUtils.js $HTDOCS_DIR/scripts mysqladmin create STEELBLUE ! /usr/bin/mysql -u root STEELBLUE < /usr/doc/SteelBlue-2.1b2/schema/mySQL.schema.sql %postun PATH=${PATH}:/usr/bin:/usr/local/bin diff -r -N --context ../SteelBlue-2.1b1/src/install/SteelBlue_psql.spec ./src/install/SteelBlue_psql.spec *** ../SteelBlue-2.1b1/src/install/SteelBlue_psql.spec Sun Feb 4 23:44:22 2001 --- ./src/install/SteelBlue_psql.spec Sat Feb 17 18:19:48 2001 *************** *** 1,6 **** Summary: The SteelBlue appserver install for Postgres Name: SteelBlue ! Version: 2.1b1 Release: psql_1 Vendor: Turner Consulting Group Copyright: commercial --- 1,6 ---- Summary: The SteelBlue appserver install for Postgres Name: SteelBlue ! Version: 2.1b2 Release: psql_1 Vendor: Turner Consulting Group Copyright: commercial *************** *** 9,15 **** URL: http://www.steelblue.com/ Packager: Robert Buccigrossi Prefix: /opt ! Source: SteelBlue_2.1b1.tar.gz patch0: SteelBlue_psql.patch %description A Web application server designed to integrate relational database --- 9,15 ---- URL: http://www.steelblue.com/ Packager: Robert Buccigrossi Prefix: /opt ! Source: SteelBlue_2.1b2.tar.gz patch0: SteelBlue_psql.patch %description A Web application server designed to integrate relational database diff -r -N --context ../SteelBlue-2.1b1/src/sbcore/EvalFunctions.cpp ./src/sbcore/EvalFunctions.cpp *** ../SteelBlue-2.1b1/src/sbcore/EvalFunctions.cpp Sun Sep 24 23:00:30 2000 --- ./src/sbcore/EvalFunctions.cpp Tue Feb 13 13:52:05 2001 *************** *** 215,221 **** Error & err_obj){ char temp[15]; time_t t = time (NULL); ! tm * l = localtime(&t); ANYARGS; sprintf (temp, "%02d-%02d-%4d", (l->tm_mon +1), l->tm_mday, (l->tm_year + 1900) ); --- 215,221 ---- Error & err_obj){ char temp[15]; time_t t = time (NULL); ! tm * l = safe_localtime(&t); ANYARGS; sprintf (temp, "%02d-%02d-%4d", (l->tm_mon +1), l->tm_mday, (l->tm_year + 1900) ); *************** *** 290,296 **** Error & err_obj){ char temp[512]; time_t t = time (NULL); ! tm * l = localtime(&t); EXACTLY(dtStrFromNow,1); --- 290,296 ---- Error & err_obj){ char temp[512]; time_t t = time (NULL); ! tm * l = safe_localtime(&t); EXACTLY(dtStrFromNow,1); *************** *** 353,359 **** // the gaps in the tm structure time_t t = mktime(l); ! l = localtime (&t); strftime (temp, 511, argv[0].c_str(), l); ret_val = temp; --- 353,359 ---- // the gaps in the tm structure time_t t = mktime(l); ! l = safe_localtime (&t); strftime (temp, 511, argv[0].c_str(), l); ret_val = temp; *************** *** 398,404 **** // the gaps in the tm structure time_t t = mktime(l); ! l = localtime (&t); strftime (temp, 511, argv[0].c_str(), l); ret_val = temp; --- 398,404 ---- // the gaps in the tm structure time_t t = mktime(l); ! l = safe_localtime (&t); strftime (temp, 511, argv[0].c_str(), l); ret_val = temp; *************** *** 429,435 **** int argc, Error & err_obj){ char temp[512]; time_t t = (time_t) (atoi(argv[1].c_str())); ! tm * l = localtime (&t); EXACTLY(dtStrFromTime,2); --- 429,435 ---- int argc, Error & err_obj){ char temp[512]; time_t t = (time_t) (atoi(argv[1].c_str())); ! tm * l = safe_localtime (&t); EXACTLY(dtStrFromTime,2); *************** *** 468,474 **** char temp[512]; int seconds = (atoi(argv[1].c_str())*60*60*24); time_t t = (time_t) (seconds); ! tm * l = localtime (&t); EXACTLY(dtStrFromEpoc,2); --- 468,474 ---- char temp[512]; int seconds = (atoi(argv[1].c_str())*60*60*24); time_t t = (time_t) (seconds); ! tm * l = safe_localtime (&t); EXACTLY(dtStrFromEpoc,2); *************** *** 505,511 **** t += ( 7 * 60 * 60 * 24); ! tm_ptr = localtime (&t); int weekday = tm_ptr->tm_wday; while (weekday != 0) --- 505,511 ---- t += ( 7 * 60 * 60 * 24); ! tm_ptr = safe_localtime (&t); int weekday = tm_ptr->tm_wday; while (weekday != 0) *************** *** 518,524 **** t -= ( 60 * 60 * 24); ! tm_ptr = localtime (&t); weekday = tm_ptr->tm_wday; } --- 518,524 ---- t -= ( 60 * 60 * 24); ! tm_ptr = safe_localtime (&t); weekday = tm_ptr->tm_wday; } *************** *** 555,561 **** t += ( 7 * 60 * 60 * 24); ! tm_ptr = localtime (&t); int weekday = tm_ptr->tm_wday; --- 555,561 ---- t += ( 7 * 60 * 60 * 24); ! tm_ptr = safe_localtime (&t); int weekday = tm_ptr->tm_wday; *************** *** 569,575 **** t -= ( 60 * 60 * 24); ! tm_ptr = localtime (&t); weekday = tm_ptr->tm_wday; } --- 569,575 ---- t -= ( 60 * 60 * 24); ! tm_ptr = safe_localtime (&t); weekday = tm_ptr->tm_wday; } *************** *** 613,619 **** t += ( 7 * 60 * 60 * 24); ! tm_ptr = localtime (&t); int weekday = tm_ptr->tm_wday; while (weekday != (atoi (argv[1].c_str()) % 7)) --- 613,619 ---- t += ( 7 * 60 * 60 * 24); ! tm_ptr = safe_localtime (&t); int weekday = tm_ptr->tm_wday; while (weekday != (atoi (argv[1].c_str()) % 7)) *************** *** 626,632 **** t -= ( 60 * 60 * 24); ! tm_ptr = localtime (&t); weekday = tm_ptr->tm_wday; } --- 626,632 ---- t -= ( 60 * 60 * 24); ! tm_ptr = safe_localtime (&t); weekday = tm_ptr->tm_wday; } *************** *** 673,679 **** // convert to and from seconds to correct the date t = mktime (d); ! tm_ptr = localtime (&t); sprintf (temp, "%02d-%02d-%02d", tm_ptr->tm_mon + 1, tm_ptr->tm_mday, tm_ptr->tm_year + 1900); --- 673,679 ---- // convert to and from seconds to correct the date t = mktime (d); ! tm_ptr = safe_localtime (&t); sprintf (temp, "%02d-%02d-%02d", tm_ptr->tm_mon + 1, tm_ptr->tm_mday, tm_ptr->tm_year + 1900); *************** *** 735,741 **** // the gaps in the tm structure time_t t = mktime(d); ! d = localtime (&t); strftime(temp,511,argv[0].c_str(), d); ret_val = temp; --- 735,741 ---- // the gaps in the tm structure time_t t = mktime(d); ! d = safe_localtime (&t); strftime(temp,511,argv[0].c_str(), d); ret_val = temp; *************** *** 1093,1099 **** // Get the current year time_t t = time(NULL); ! tm * l = localtime(&t); int current_year = 1900 + l->tm_year; if (year < 100){ // Convert to 4 digit year --- 1093,1099 ---- // Get the current year time_t t = time(NULL); ! tm * l = safe_localtime(&t); int current_year = 1900 + l->tm_year; if (year < 100){ // Convert to 4 digit year diff -r -N --context ../SteelBlue-2.1b1/src/sbcore/time_util.cpp ./src/sbcore/time_util.cpp *** ../SteelBlue-2.1b1/src/sbcore/time_util.cpp Tue May 9 20:55:01 2000 --- ./src/sbcore/time_util.cpp Tue Feb 13 13:52:05 2001 *************** *** 5,10 **** --- 5,22 ---- #include #endif + /* This is a "safe" version of localtime that calls localtime, but + if NULL is returned, returns 12/31/1969. This is needed so that + Win32 time functions behave like UNIX functions */ + tm * safe_localtime(time_t * timer){ + tm * mytm = localtime(timer); + if (mytm == NULL){ + time_t new_time = 1; + mytm = localtime(&new_time); + } + return(mytm); + } + /* This function converts a time_t structure (seconds since Jan 1 1970) to the form YYYYMMDDHHMMSS */ diff -r -N --context ../SteelBlue-2.1b1/src/sbcore/time_util.h ./src/sbcore/time_util.h *** ../SteelBlue-2.1b1/src/sbcore/time_util.h Tue May 9 20:55:01 2000 --- ./src/sbcore/time_util.h Tue Feb 13 13:52:05 2001 *************** *** 4,9 **** --- 4,10 ---- #include "string_util.h" #include + tm * safe_localtime(time_t * timer); string time2YYYYMMDDHHMMSS (time_t t=0); int DaysInMonth (int month, int year); int ParseDateString (string s, int * month = NULL, int * day = NULL,