1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
$NetBSD: patch-at,v 1.1 2005/03/16 12:48:49 rillig Exp $
gcc-2.95.3 does not like code intermixed with declarations.
--- src/idle-dialog.c.orig Sat May 8 18:14:49 2004
+++ src/idle-dialog.c Wed Mar 16 10:47:21 2005
@@ -111,12 +111,13 @@ util_escape_html_markup (const char *str
{
char * p;
char * ret;
+ int ampcnt = 0, len;
+ const char *start;
p = strchr (str, '&');
if (!p) return g_strdup (str);
/* count number of ampersands */
- int ampcnt = 0;
while (p)
{
ampcnt ++;
@@ -124,12 +125,12 @@ util_escape_html_markup (const char *str
}
/* make room for the escapes */
- int len = strlen(str);
+ len = strlen(str);
ret = g_new0 (char, len+4*ampcnt+1);
/* replace & by & unless its already & */
p = strchr (str, '&');
- const char *start = str;
+ start = str;
while (p)
{
strncat (ret, start, p-start);
@@ -155,7 +156,7 @@ display_value (GttIdleDialog *dlg, time_
{
char tbuff [30];
char mbuff [130];
- char * msg;
+ char *msg, *ptitle, *pdesc;
time_t now = time(0);
time_t idle_time;
@@ -201,9 +202,9 @@ display_value (GttIdleDialog *dlg, time_
/* Update the total elapsed time part of the message */
idle_time = now - dlg->last_activity;
- char *ptitle = util_escape_html_markup (
+ ptitle = util_escape_html_markup (
gtt_project_get_title(dlg->prj));
- char *pdesc = util_escape_html_markup (
+ pdesc = util_escape_html_markup (
gtt_project_get_desc(dlg->prj));
if (3600 > idle_time)
{
|