[seahorse] Ssh: key parsing: relax the whitespace separator.
- From: Niels De Graef <nielsdg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [seahorse] Ssh: key parsing: relax the whitespace separator.
- Date: Thu, 8 Mar 2018 21:30:02 +0000 (UTC)
commit e52524c30e423f01b7cf3b64e5030087e023a2e6
Author: Niels De Graef <nielsdegraef gmail com>
Date: Wed Mar 7 18:45:17 2018 +0100
Ssh: key parsing: relax the whitespace separator.
Apparently, some software also allows tabs in separators for keys,
so we can do that as well.
ssh/key-data.vala | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/ssh/key-data.vala b/ssh/key-data.vala
index 3e35ba0..ac3e5b2 100644
--- a/ssh/key-data.vala
+++ b/ssh/key-data.vala
@@ -63,7 +63,7 @@ public class Seahorse.Ssh.KeyData : GLib.Object {
result.rawdata = no_leading;
// Get the type
- string[] type_rest = no_leading.split(" ", 2);
+ string[] type_rest = no_leading.split_set(" \t", 2);
if (type_rest.length != 2)
throw new Error.GENERAL("Can't distinguish type from data (space missing).");
@@ -79,7 +79,7 @@ public class Seahorse.Ssh.KeyData : GLib.Object {
string rest = type_rest[1];
if (rest == "")
throw new Error.GENERAL("Key doesn't have any data.");
- string[] data_comment = rest.split(" ", 2);
+ string[] data_comment = rest.split_set(" \t", 2);
// Decode it, and parse binary stuff
uchar[] bytes = Base64.decode(data_comment[0].strip());
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]