Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:zhonghuaren
leave
leave-1.8.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File leave-1.8.patch of Package leave
diff -r -u leave-1.8/Makefile leave-1.8-patch/Makefile --- leave-1.8/Makefile Sun Oct 19 15:20:03 1997 +++ leave-1.8-patch/Makefile Thu Dec 14 16:50:49 2000 @@ -1,6 +1,15 @@ # $NetBSD: Makefile,v 1.5 1997/10/19 03:44:24 lukem Exp $ # @(#)Makefile 8.1 (Berkeley) 6/6/93 -PROG= leave +CC=gcc +CFLAGS=-O2 -.include <bsd.prog.mk> +leave: leave.c + +install: leave leave.1 + strip leave + install -o root -g root -m 0755 leave /usr/bin/leave + install -o root -g root -m 0644 leave.1 /usr/share/man/man1/leave.1 + +clean: + rm -f leave Only in leave-1.8-patch: leave diff -r -u leave-1.8/leave.1 leave-1.8-patch/leave.1 --- leave-1.8/leave.1 Sun Oct 19 15:20:03 1997 +++ leave-1.8-patch/leave.1 Thu Dec 14 15:51:03 2000 @@ -70,8 +70,9 @@ hours (on a 12 or 24 hour clock), and .Ar mm are minutes. -All times are converted to a 12 hour clock, and assumed to -be in the next 12 hours. +If +.Ar hh +is between 1 and 12, it is interpreted according to a 12-hour clock. .It Cm \&+ If the time is preceded by .Ql Cm \&+ , diff -r -u leave-1.8/leave.c leave-1.8-patch/leave.c --- leave-1.8/leave.c Sun Dec 20 13:17:46 1998 +++ leave-1.8-patch/leave.c Thu Dec 14 16:00:07 2000 @@ -34,18 +34,6 @@ */ #include <sys/cdefs.h> -#ifndef lint -__COPYRIGHT("@(#) Copyright (c) 1980, 1988, 1993\n\ - The Regents of the University of California. All rights reserved.\n"); -#endif /* not lint */ - -#ifndef lint -#if 0 -static char sccsid[] = "@(#)leave.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: leave.c,v 1.8 1998/12/19 17:44:22 christos Exp $"); -#endif -#endif /* not lint */ #include <sys/param.h> #include <sys/time.h> @@ -114,15 +102,22 @@ if (plusnow) secs = hours * 60 * 60 + minutes * 60; else { + int mil_clock = (hours < 1 || hours > 12); if (hours > 23) usage(); - if (t->tm_hour >= 12) - t->tm_hour -= 12; - if (t->tm_hour > hours || - (t->tm_hour == hours && minutes <= t->tm_min)) + hours -= t->tm_hour; + minutes -= t->tm_min; + if (minutes < 0) { + minutes += 60; + hours -= 1; + } + if (hours < 0) { hours += 12; - secs = (hours - t->tm_hour) * 60 * 60; - secs += (minutes - t->tm_min) * 60; + if (mil_clock || hours < 0) + hours += 12; + } + secs = hours * 60 * 60; + secs += minutes * 60; } doalarm(secs); exit(0);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor