Bug#854019: Fw: Patch for lunar.c while lunar.clock == 23

2017-02-03 Thread Xie Xun


 On Saturday, February 4, 2017 1:42 AM, usv  
wrote:
 

 Hi,  Xie Xun
-cut-here-
--- lunar/lunar.orig    2001-10-29 13:55:39.0 +0800
+++ lunar/lunar.c    2017-02-04 00:58:07.487220461 +0800
@@ -271,12 +271,18 @@
    int adj;
    Date *d;
 
-    /* A solar day begins at 12 a.m. */
-    adj = (lunar.hour == 23)? -1 : 0;
    offset = Lunar2Day(&lunar);
-    solar.weekday = (offset+ adj + SolarFirstDate.weekday) % 7;
-    Day2Solar(offset + adj, &solar);
+    solar.weekday = (offset + SolarFirstDate.weekday) % 7;
+    Day2Solar(offset, &solar);
    solar.hour = lunar.hour;
+
+    /* A lunar day begins at 11 p.m. so this time is next lunar day */
+    if (lunar.hour == 23)
+      {
+        Day2Lunar(offset + 1, &lunar);
+        offset = Lunar2Day(&lunar);
+      }
+
    CalGZ(offset, &lunar, &gan, &zhi);
 
    jieAlert = JieDate(&solar, &lunar2);
---end-patch-
Thanks
lunar user


   

Bug#854019:

2017-02-02 Thread Xie Xun
The version is actually 2.2-6.


Bug#854019: lunar: unmatched time when query solar 2017 01 28 22 and 2017 01 28 23

2017-02-02 Thread Xie Xun
Package: lunar
Version: 2.2-4
Severity: important
Tags: patch

The bug was reported by . However, it seems that
he/she's not reported the bug to the bug tracking system.
Below is a copy of his/her email:

___
Hi, Xie Xun
lunar datetime goback from 2017年 2月24日22时2017年 2月23日23时
when query the solar  from 2017 01 28 22  to 2017 01 28 23
thanks
lunar -u -s -i 2017 01 28 22
Lunar Version 2.2-6 (Debian) (January 2, 2017)

阳历: 2017年 2月24日22时 星期五
阴历: 2017年 1月28日亥时 生肖属鸡
干支: 丁酉年 壬寅月 壬午日 辛亥时 
用四柱神算推算之时辰八字: 丁酉年 壬寅月 壬午日 辛亥

lunar -u -s -i 2017 01 28 23
Lunar Version 2.2-6 (Debian) (January 2, 2017)

阳历: 2017年 2月23日23时 星期四
阴历: 2017年 1月28日子时 生肖属鸡
干支: 丁酉年 壬寅月 壬午日 庚子时 
用四柱神算推算之时辰八字: 丁酉年 壬寅月 壬午日 庚子
__

and his/her patch:

__
Hi, Xie Xun
This is the patch for lunar about not continue datetime from lunar to solar
query:
--- lunar/lunar.orig2001-10-29 13:55:39.0 +0800
+++ lunar/lunar.c2017-02-03 06:22:18.957411341 +0800
@@ -250,7 +250,7 @@
offset = Solar2Day(&solar);
solar.weekday = (offset + SolarFirstDate.weekday) % 7;

-/* A lunar day begins at 11 p.m. */
+/* A lunar day begins at 11 p.m. of lastday */
if (solar.hour == 23)
offset++;

@@ -271,8 +271,8 @@
int adj;
Date *d;

-/* A solar day begins at 12 a.m. */
-adj = (lunar.hour == 23)? -1 : 0;
+/* A solar day begins at 12 a.m. (00 a.m.) */
+adj = (lunar.hour == 0)? -1 : 0;
offset = Lunar2Day(&lunar);
solar.weekday = (offset+ adj + SolarFirstDate.weekday) % 7;
Day2Solar(offset + adj, &solar);

thanks


USV seems to use an invalid email address, so I can't contact with him/her
directly.
Nevertheless, thank usv for his/her report.



-- System Information:
Debian Release: 8.7
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.6.0-0.bpo.1-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages lunar depends on:
ii  libc6  2.19-18+deb8u7

lunar recommends no packages.

lunar suggests no packages.

-- no debconf information



Bug#792472: My patch

2015-07-14 Thread Xie Xun
Although nYear is useless, make_yday() is needed.



patches.xx.tar.gz
Description: application/gzip


signature.asc
Description: OpenPGP digital signature