ls.c (1591) | ls.c (9987) |
---|---|
1/* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 29 unchanged lines hidden (view full) --- 38#include <sys/param.h> 39#include <sys/stat.h> 40 41#include <err.h> 42#include <errno.h> 43#include <stdio.h> 44#include <string.h> 45#include <time.h> | 1/* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 29 unchanged lines hidden (view full) --- 38#include <sys/param.h> 39#include <sys/stat.h> 40 41#include <err.h> 42#include <errno.h> 43#include <stdio.h> 44#include <string.h> 45#include <time.h> |
46#include <tzfile.h> | |
47#include <unistd.h> 48#include <utmp.h> 49 50/* Derived from the print routines in the ls(1) source code. */ 51 52static void printlink __P((char *)); 53static void printtime __P((time_t)); 54 --- 30 unchanged lines hidden (view full) --- 85 int i; 86 char *longstring, *ctime(); 87 time_t time(); 88 89 longstring = ctime((long *)&ftime); 90 for (i = 4; i < 11; ++i) 91 (void)putchar(longstring[i]); 92 | 46#include <unistd.h> 47#include <utmp.h> 48 49/* Derived from the print routines in the ls(1) source code. */ 50 51static void printlink __P((char *)); 52static void printtime __P((time_t)); 53 --- 30 unchanged lines hidden (view full) --- 84 int i; 85 char *longstring, *ctime(); 86 time_t time(); 87 88 longstring = ctime((long *)&ftime); 89 for (i = 4; i < 11; ++i) 90 (void)putchar(longstring[i]); 91 |
93#define SIXMONTHS ((DAYSPERNYEAR / 2) * SECSPERDAY) | 92#define SIXMONTHS ((365 / 2) * 86400) |
94 if (ftime + SIXMONTHS > time((time_t *)NULL)) 95 for (i = 11; i < 16; ++i) 96 (void)putchar(longstring[i]); 97 else { 98 (void)putchar(' '); 99 for (i = 20; i < 24; ++i) 100 (void)putchar(longstring[i]); 101 } --- 17 unchanged lines hidden --- | 93 if (ftime + SIXMONTHS > time((time_t *)NULL)) 94 for (i = 11; i < 16; ++i) 95 (void)putchar(longstring[i]); 96 else { 97 (void)putchar(' '); 98 for (i = 20; i < 24; ++i) 99 (void)putchar(longstring[i]); 100 } --- 17 unchanged lines hidden --- |