Bug 88452 - x11-fm/filerunner: Filerunner-2.5.1 modulo year = 00xx instead of 20xx in file dates
Summary: x11-fm/filerunner: Filerunner-2.5.1 modulo year = 00xx instead of 20xx in fil...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-03 13:40 UTC by User1001
Modified: 2005-11-13 15:07 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description User1001 2005-11-03 13:40:14 UTC

FileRunner 4-digit year date correction (%2d -> %4d) left modulo division inline which converted 20xx years to 00xx string. Change,

	time_s->tm_year % 100

to

	time_s->tm_year

in files/patch-ac

Fix: 

time_s = localtime(&t);
    if (dateformat)
!     sprintf(interp->result, "%02d%02d%02d %02d:%02d:%02d", time_s->tm_mday, time_s->tm_mon+1,
!           time_s->tm_year % 100, time_s->tm_hour, time_s->tm_min, time_s->tm_sec);
    else
!     sprintf(interp->result, "%02d%02d%02d %02d:%02d:%02d", time_s->tm_year % 100, time_s->tm_mon+1,
            time_s->tm_mday, time_s->tm_hour, time_s->tm_min, time_s->tm_sec);
    return TCL_OK;
  }
--- 123,134 ----
    HANDLE2(*p != '\0', "Error converting arg to int");

    time_s = localtime(&t);
+   time_s->tm_year = 1900 + time_s->tm_year;
    if (dateformat)
!     sprintf(interp->result, "%02d%02d%04d %02d:%02d:%02d", time_s->tm_mday, time_s->tm_mon+1,
!           time_s->tm_year, time_s->tm_hour, time_s->tm_min, time_s->tm_sec);
    else
!     sprintf(interp->result, "%04d%02d%02d %02d:%02d:%02d", time_s->tm_year, time_s->tm_mon+1,
            time_s->tm_mday, time_s->tm_hour, time_s->tm_min, time_s->tm_sec);
    return TCL_OK;
  }--kf4hGc9UlfFXW8GjnaMeu4PLtTVtRpQ7gy5LU9dekSX0165X
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

*** ext.c.orig  Thu Dec 30 11:21:49 1999
--- ext.c       Thu Nov  3 07:26:35 2005
***************
*** 123,133 ****
    HANDLE2(*p != '\0', "Error converting arg to int");
Comment 1 Volker Stolz freebsd_committer freebsd_triage 2005-11-08 15:21:58 UTC
State Changed
From-To: open->feedback

Forwarded PR to maintainer
Comment 2 Andrew Pogrebennyk 2005-11-13 12:16:47 UTC
ports/88452 approved by maintainer as ports/88916. Thanks!
Comment 3 Mark Linimon freebsd_committer freebsd_triage 2005-11-13 15:07:28 UTC
State Changed
From-To: feedback->closed

Superceded by ports/88916.