Commit aeb7fc96 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(get_last_text): Fixed a bug introduced 12 oct 1993: dates were

compared backwards.
parent ecccdae8
/*
* $Id: text.c,v 0.29 1994/06/18 20:41:37 ceder Exp $
* $Id: text.c,v 0.30 1994/06/29 23:08:20 ceder Exp $
* Copyright (C) 1991, 1992, 1993, 1994 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -28,7 +28,7 @@
* All atomic calls that deals with texts.
*/
static char *rcsid = "$Id: text.c,v 0.29 1994/06/18 20:41:37 ceder Exp $";
static char *rcsid = "$Id: text.c,v 0.30 1994/06/29 23:08:20 ceder Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -2023,8 +2023,8 @@ delete_text( Text_no text_no )
/*
* Lookup a text according to creation-time.
* The text-no of the text created closest before TIME is returned.
* The text text-no might not be readable.
* The text-no of the text created closest before WANTED_TIME is returned.
* The returned text is not necessarily readable.
*/
extern Success
get_last_text(struct tm *wanted_time,
......@@ -2058,12 +2058,12 @@ get_last_text(struct tm *wanted_time,
else
{
texttime = localtime(&text_stat->creation_time);
if (texttime->tm_year > wanted_time->tm_year
|| texttime->tm_mon > wanted_time->tm_mon
|| texttime->tm_mday > wanted_time->tm_mday
|| texttime->tm_hour > wanted_time->tm_hour
|| texttime->tm_min > wanted_time->tm_min
|| texttime->tm_sec > wanted_time->tm_sec)
if (wanted_time->tm_year > texttime->tm_year
|| wanted_time->tm_mon > texttime->tm_mon
|| wanted_time->tm_mday > texttime->tm_mday
|| wanted_time->tm_hour > texttime->tm_hour
|| wanted_time->tm_min > texttime->tm_min
|| wanted_time->tm_sec > texttime->tm_sec)
{
lower = try - 1;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment