#2 journal popup does not appear

v1.4.x
closed-fixed
ghtml (13)
5
2007-12-21
2002-10-07
No

On solaris, the popup (to edit entries in the journal)
does not appear.
The reason is that the code assumes that printf (%p)
will result in output
that looks like "0x.." unfortunately the solaris
printf does NOT output
%p in this format.

The following patch corrects the problem by always
outputting 0x and then
using sscanf() to parse the result (as per the Solaris
and Linux man
pages).

RCS file: /cvs/gnome/gnome-utils/gtt/Attic/journal.c,v
retrieving revision 1.24.2.6
diff -u -r1.24.2.6 journal.c
--- journal.c 2001/12/01 06:13:54 1.24.2.6
+++ journal.c 2002/06/25 17:51:14
@@ -491,7 +491,8 @@
str = strstr (url, "0x");
if (str)
{
- addr = (gpointer) strtoul (str, NULL, 16);
+ str+=2;
+ sscanf (str, "%p", &addr);
}

if (0 == strncmp (url, "gtt:interval", 12))

RCS file: /cvs/gnome/gnome-utils/gtt/Attic/ghtml.c,v
retrieving revision 1.6.2.7
diff -u -r1.6.2.7 ghtml.c
--- ghtml.c 2001/11/24 06:06:22 1.6.2.7
+++ ghtml.c 2002/06/25 17:51:14
@@ -107,7 +107,7 @@
p = prn;
p = stpcpy (p, "<tr><td colspan=4>"
"<a href=\"gtt:task:");
- p += sprintf (p, "%p\">", tsk);
+ p += sprintf (p, "0x%p\">", tsk);

pp = gtt_task_get_memo(tsk);
if (!pp || !pp[0]) pp = _("(empty)");
@@ -131,7 +131,7 @@

"<tr><td>   "
"<td
align=right>  "
"<a href=\"gtt:interval:");
- p += sprintf (p, "%p\">", ivl);
+ p += sprintf (p, "0x%p\">", ivl);

/* print hour only or date too? */
if (0 != prev_stop) {
@@ -149,7 +149,7 @@
"</a>  "
"<td>  "
"<a href=\"gtt:interval:");
- p += sprintf (p, "%p\">", ivl);
+ p += sprintf (p, "0x%p\">", ivl);
if (prt_date) {
p = print_date_time (p,
70, stop);
} else {
@@ -363,7 +363,7 @@
if (show_links)
{
p =
stpcpy (p, "<a
href=\"gtt:task:");
- p +=
sprintf (p, "%p\">",
tsk);
+ p +=
sprintf (p, "0x%p\">",
tsk);
}
pp =
gtt_task_get_memo(tsk);
if (!pp ||
!pp[0]) pp =
_("(empty)");
@@ -495,7 +495,7 @@
p = stpcpy (p, "<td
align=right>  ");
if (show_links)
{
- p += sprintf (p, "<a
href=\"gtt:interval:%p\">",
ivl);
+ p += sprintf (p, "<a
href=\"gtt:interval:0x%p\">",
ivl);
}
if (prt_start_date) {
p = print_date_time (p, 100,
start);
@@ -511,7 +511,7 @@
p = stpcpy (p, "<td
align=right>  ");
if (show_links)
{
- p += sprintf (p, "<a
href=\"gtt:interval:%p\">",
ivl);
+ p += sprintf (p, "<a
href=\"gtt:interval:0x%p\">",
ivl);
}
if (prt_stop_date) {
p = print_date_time (p, 100, stop);

------- Additional Comments From Gman 2002-06-26 10:55
-------

Linas, this is one for you.

Discussion

  • Linas Vepstas

    Linas Vepstas - 2002-12-21

    Logged In: YES
    user_id=11545

    applied patch thatt should work to gnome2 cvs source

     
  • Linas Vepstas

    Linas Vepstas - 2002-12-21
    • status: open --> closed-fixed
     
  • Linas Vepstas

    Linas Vepstas - 2007-12-21
    • labels: --> ghtml
    • assigned_to: nobody --> linas
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks