File: 00-support_now_timevalue.patch

package info (click to toggle)
gphoto2 2.5.11-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 5,460 kB
  • ctags: 830
  • sloc: ansic: 6,609; sh: 4,844; perl: 309; makefile: 127; sed: 16
file content (23 lines) | stat: -rw-r--r-- 853 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Subject: support 'now' 
Origin: vendor, http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=618651
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=618651
Forwarded: no
Reviewed-by: Herbert Parentes Fortes Neto <hpfn@ig.com.br>
Last-Update: 2016-04-02

Index: gphoto2-2.5.10/gphoto2/actions.c
===================================================================
--- gphoto2-2.5.10.orig/gphoto2/actions.c
+++ gphoto2-2.5.10/gphoto2/actions.c
@@ -2062,8 +2062,10 @@ set_config_value_action (GPParams *p, co
 		int	t = -1;
 		struct tm xtm;
 
+		if (!strcasecmp (value, "now")  || !strcasecmp (value, _("now")))
+			t = time(NULL);
 #ifdef HAVE_STRPTIME
-		if (strptime (value, "%c", &xtm) || strptime (value, "%Ec", &xtm))
+		else if (strptime (value, "%c", &xtm) || strptime (value, "%Ec", &xtm))
 			t = mktime (&xtm);
 #endif
 		if (t == -1) {