{
gchar* current_dir;
gchar* result;
+ gchar** parts;
gchar* search;
const gchar* search_uri;
- gchar** parts;
KatzeItem* item;
g_return_val_if_fail (uri, NULL);
if (!strstr (uri, "://"))
{
/* Do we have a domain, ip address or localhost? */
- if (strchr (uri, '.') != NULL || strchr (uri, ':')
- || !strcmp (uri, "localhost"))
+ parts = g_strsplit (uri, ".", 0);
+ if (parts[0] && parts[1])
+ {
+ search = NULL;
+ if (!(parts[1][1] == '\0' && !g_ascii_isalpha (parts[1][0])))
+ search = g_strconcat ("http://", uri, NULL);
+ g_free (parts);
+ if (search)
+ return search;
+ }
+ if (strchr (uri, ':') || !strcmp (uri, "localhost"))
return g_strconcat ("http://", uri, NULL);
/* We don't want to search? So return early. */
if (!search_engines)
import Common
import sys
import os
+import UnitTest
APPNAME = 'midori'
VERSION = '0.1.0'
else:
Params.pprint ('BLUE', "logo-shade could not be rasterized.")
+ if Params.g_commands['check']:
+ bld.add_subdirs ('tests')
+
def shutdown ():
if Params.g_commands['install'] or Params.g_commands['uninstall']:
dir = Common.path_install ('DATADIR', 'icons/hicolor')
Params.pprint ('YELLOW', "Icon cache not updated. After install, run this:")
Params.pprint ('YELLOW', "gtk-update-icon-cache -q -f -t %s" % dir)
+ elif Params.g_commands['check']:
+ test = UnitTest.unit_test ()
+ test.change_to_testfile_dir = True
+ test.want_to_see_test_output = True
+ test.want_to_see_test_error = True
+ test.run ()
+ test.print_results ()
+
elif Params.g_options.update_po:
os.chdir('./po')
try: