Commit c878ad82 authored by Jiří Klimeš's avatar Jiří Klimeš

cli: trivial, fix up spacing

parent 38a988cb
......@@ -1769,7 +1769,7 @@ parse_cmd (NmCli *nmc, int argc, char **argv)
nmc->return_value = do_connections_list (nmc, argc, argv);
} else {
if (matches (*argv, "list") == 0) {
if (matches (*argv, "list") == 0) {
nmc->return_value = do_connections_list (nmc, argc-1, argv+1);
}
else if (matches(*argv, "status") == 0) {
......@@ -1836,7 +1836,7 @@ do_connections (NmCli *nmc, int argc, char **argv)
else {
while (real_con_commands[i] && matches (*argv, real_con_commands[i]) != 0)
i++;
if (real_con_commands[i] != NULL)
if (real_con_commands[i] != NULL)
real_cmd = TRUE;
}
......
......@@ -515,7 +515,7 @@ ap_wpa_rsn_flags_to_string (NM80211ApSecurityFlags flags)
i = 0;
while (flags_str[i])
g_free (flags_str[i++]);
g_free (flags_str[i++]);
return ret_str;
}
......@@ -1120,7 +1120,7 @@ do_devices_list (NmCli *nmc, int argc, char **argv)
device = candidate;
}
if (!device) {
g_string_printf (nmc->return_text, _("Error: Device '%s' not found."), iface);
g_string_printf (nmc->return_text, _("Error: Device '%s' not found."), iface);
nmc->return_value = NMC_RESULT_ERROR_UNKNOWN;
goto error;
}
......@@ -1409,7 +1409,7 @@ do_device_wifi_list (NmCli *nmc, int argc, char **argv)
}
if (!device) {
g_string_printf (nmc->return_text, _("Error: Device '%s' not found."), iface);
g_string_printf (nmc->return_text, _("Error: Device '%s' not found."), iface);
nmc->return_value = NMC_RESULT_ERROR_UNKNOWN;
goto error;
}
......@@ -1429,7 +1429,7 @@ do_device_wifi_list (NmCli *nmc, int argc, char **argv)
g_free (bssid_up);
}
if (!ap) {
g_string_printf (nmc->return_text, _("Error: Access point with bssid '%s' not found."), bssid_user);
g_string_printf (nmc->return_text, _("Error: Access point with bssid '%s' not found."), bssid_user);
nmc->return_value = NMC_RESULT_ERROR_UNKNOWN;
goto error;
}
......@@ -1446,7 +1446,7 @@ do_device_wifi_list (NmCli *nmc, int argc, char **argv)
show_acces_point_info (device, nmc);
}
} else {
g_string_printf (nmc->return_text, _("Error: Device '%s' is not a WiFi device."), iface);
g_string_printf (nmc->return_text, _("Error: Device '%s' is not a WiFi device."), iface);
nmc->return_value = NMC_RESULT_ERROR_UNKNOWN;
goto error;
}
......@@ -1483,7 +1483,7 @@ do_device_wifi_list (NmCli *nmc, int argc, char **argv)
}
}
if (!ap) {
g_string_printf (nmc->return_text, _("Error: Access point with bssid '%s' not found."), bssid_user);
g_string_printf (nmc->return_text, _("Error: Access point with bssid '%s' not found."), bssid_user);
nmc->return_value = NMC_RESULT_ERROR_UNKNOWN;
goto error;
}
......@@ -2066,7 +2066,7 @@ do_device_wimax_list (NmCli *nmc, int argc, char **argv)
}
if (!device) {
g_string_printf (nmc->return_text, _("Error: Device '%s' not found."), iface);
g_string_printf (nmc->return_text, _("Error: Device '%s' not found."), iface);
nmc->return_value = NMC_RESULT_ERROR_UNKNOWN;
goto error;
}
......@@ -2086,7 +2086,7 @@ do_device_wimax_list (NmCli *nmc, int argc, char **argv)
g_free (nsp_up);
}
if (!nsp) {
g_string_printf (nmc->return_text, _("Error: NSP with name '%s' not found."), nsp_user);
g_string_printf (nmc->return_text, _("Error: NSP with name '%s' not found."), nsp_user);
nmc->return_value = NMC_RESULT_ERROR_UNKNOWN;
goto error;
}
......@@ -2097,7 +2097,7 @@ do_device_wimax_list (NmCli *nmc, int argc, char **argv)
show_nsp_info (device, nmc);
}
} else {
g_string_printf (nmc->return_text, _("Error: Device '%s' is not a WiMAX device."), iface);
g_string_printf (nmc->return_text, _("Error: Device '%s' is not a WiMAX device."), iface);
nmc->return_value = NMC_RESULT_ERROR_UNKNOWN;
goto error;
}
......@@ -2128,7 +2128,7 @@ do_device_wimax_list (NmCli *nmc, int argc, char **argv)
}
}
if (!nsp) {
g_string_printf (nmc->return_text, _("Error: Access point with nsp '%s' not found."), nsp_user);
g_string_printf (nmc->return_text, _("Error: Access point with nsp '%s' not found."), nsp_user);
nmc->return_value = NMC_RESULT_ERROR_UNKNOWN;
goto error;
}
......
......@@ -135,7 +135,7 @@ show_nm_status (NmCli *nmc)
fields_str = fields_common;
else if (!nmc->required_fields || strcasecmp (nmc->required_fields, "all") == 0)
fields_str = fields_all;
else
else
fields_str = nmc->required_fields;
nmc->allowed_fields = nmc_fields_nm_status;
......@@ -214,8 +214,8 @@ static void networking_set_sleep (NmCli *nmc, gboolean in_sleep)
if (!connection) {
g_string_printf (nmc->return_text, _("Error: Couldn't connect to system bus: %s"), err->message);
nmc->return_value = NMC_RESULT_ERROR_UNKNOWN;
g_error_free (err);
goto gone;
g_error_free (err);
goto gone;
}
proxy = dbus_g_proxy_new_for_name (connection,
......@@ -226,8 +226,8 @@ static void networking_set_sleep (NmCli *nmc, gboolean in_sleep)
g_string_printf (nmc->return_text, _("Error: Couldn't create D-Bus object proxy."));
nmc->return_value = NMC_RESULT_ERROR_UNKNOWN;
goto gone;
}
}
if (!dbus_g_proxy_call (proxy, "Sleep", &err, G_TYPE_BOOLEAN, in_sleep, G_TYPE_INVALID, G_TYPE_INVALID)) {
g_string_printf (nmc->return_text, _("Error in sleep: %s"), err->message);
nmc->return_value = NMC_RESULT_ERROR_UNKNOWN;
......
......@@ -69,7 +69,7 @@ ssid_to_printable (const char *str, gsize len)
int i;
if (str == NULL || len == 0)
return NULL;
return NULL;
if (g_utf8_validate (str, len, NULL))
return g_strdup_printf ("'%.*s'", (int) len, str);
......@@ -471,7 +471,7 @@ nmc_is_nm_running (NmCli *nmc, GError **error)
g_set_error (error, 0, 0, "%s", nmc->return_text->str);
goto done;
}
if (!org_freedesktop_DBus_name_has_owner (proxy, NM_DBUS_SERVICE, &has_owner, &err)) {
g_string_printf (nmc->return_text, _("Error: NameHasOwner request failed: %s"),
(err && err->message) ? err->message : _("(unknown)"));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment