Added some debugging code, and tidy, tidy, tidy.

SVN revision: 1407
This commit is contained in:
Tom Gilbert 1999-11-25 17:59:23 +00:00
parent 014e7ab5cc
commit d0693cdabb
2 changed files with 23 additions and 3 deletions

View File

@ -377,6 +377,8 @@ validate_url (char *url)
char *ret = NULL;
static char *orig_ret = NULL;
D(("In validate_url: url -->%s<--\n",url));
if (orig_ret)
free (orig_ret);
@ -420,6 +422,8 @@ validate_url (char *url)
free (temp);
}
D(("In validate_url: ret -->%s<--\n",ret));
/* Now some checks */
if (strlen (ret) < 1)
return 0;
@ -524,14 +528,15 @@ handle_url (char *url, char *type)
if (url == NULL)
return;
/* printf ("url -->%s<--\n", url); */
D(("In handle_url: url -->%s<--\n", url));
if ((validurl = validate_url (url)) == NULL)
return;
display_string (validurl);
/* printf ("valid url -->%s<--\n", url); */
D (("In handle_url: valid url -->%s<--\n", validurl));
if (!strcmp (type, "www"))
{
sys = _Strjoin (" ", opt.www_command, validurl, "&", NULL);
@ -549,7 +554,7 @@ handle_url (char *url, char *type)
sys = _Strjoin (" ", opt.www_command, validurl, "&", NULL);
}
/* printf ("sys -->%s<--\n", sys); */
D (("In handle_url: About to system() -->%s<--\n", sys));
system (sys);
@ -566,6 +571,8 @@ cb_shoot (void *data)
char *url;
url = get_url_from_paste_buffer ();
D(("In cb_shoot: url -->%s<--\n",url));
handle_url (url, data);

View File

@ -1,3 +1,16 @@
#if 0
#define D(a) { \
printf("%s +%u : ",__FILE__,__LINE__); \
printf a; \
fflush(stdout); \
}
#else
#define D(a) { \
/* No debug */; \
}
#endif
Epplet_gadget btn_conf, btn_close, btn_help, btn_ctimer, btn_www, btn_ftp, btn_wget;
Epplet_gadget btn_col, lbl_url;
Epplet_gadget p, col_p, ctimer_p, stimer_p;