1 |
gurligebis 10/05/29 09:54:59 |
2 |
|
3 |
Added: fix-ssid-combo.patch |
4 |
Log: |
5 |
Fixing bug #321627 |
6 |
(Portage version: 2.2_rc67/cvs/Linux i686) |
7 |
|
8 |
Revision Changes Path |
9 |
1.1 net-wireless/wpa_supplicant/files/fix-ssid-combo.patch |
10 |
|
11 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-wireless/wpa_supplicant/files/fix-ssid-combo.patch?rev=1.1&view=markup |
12 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-wireless/wpa_supplicant/files/fix-ssid-combo.patch?rev=1.1&content-type=text/plain |
13 |
|
14 |
Index: fix-ssid-combo.patch |
15 |
=================================================================== |
16 |
From: Kel Modderman <kel@×××××××.de> |
17 |
Date: Sun, 2 May 2010 08:17:13 +0000 (+0300) |
18 |
Subject: wpa_gui-qt4: Fix network selection |
19 |
X-Git-Url: http://hostap.epitest.fi/gitweb/gitweb.cgi?p=hostap.git;a=commitdiff_plain;h=1491f8a78516a5c773583125bd9691323249a6dc;hp=adc8d4a791ca7ef5245d2030d7096cf8675a3720 |
20 |
|
21 |
wpa_gui-qt4: Fix network selection |
22 |
|
23 |
Use regular expression matches to see if input is not the (now translated?) |
24 |
string "Select any network" and is a "<network id>: <ssid>" string or the |
25 |
"all" keyword where that is applicable. |
26 |
|
27 |
Signed-off-by: Kel Modderman <kel@×××××××.de> |
28 |
--- |
29 |
|
30 |
diff --git a/wpa_supplicant/wpa_gui-qt4/wpagui.cpp b/wpa_supplicant/wpa_gui-qt4/wpagui.cpp |
31 |
index 94220f4..e15d751 100644 |
32 |
--- a/wpa_supplicant/wpa_gui-qt4/wpagui.cpp |
33 |
+++ b/wpa_supplicant/wpa_gui-qt4/wpagui.cpp |
34 |
@@ -971,17 +971,10 @@ void WpaGui::selectNetwork( const QString &sel ) |
35 |
char reply[10]; |
36 |
size_t reply_len = sizeof(reply); |
37 |
|
38 |
- if (cmd.compare(tr("Select any network"))) { |
39 |
+ if (cmd.contains(QRegExp("^\\d+:"))) |
40 |
+ cmd.truncate(cmd.indexOf(':')); |
41 |
+ else |
42 |
cmd = "any"; |
43 |
- } else { |
44 |
- int pos = cmd.indexOf(':'); |
45 |
- if (pos < 0) { |
46 |
- printf("Invalid selectNetwork '%s'\n", |
47 |
- cmd.toAscii().constData()); |
48 |
- return; |
49 |
- } |
50 |
- cmd.truncate(pos); |
51 |
- } |
52 |
cmd.prepend("SELECT_NETWORK "); |
53 |
ctrlRequest(cmd.toAscii().constData(), reply, &reply_len); |
54 |
triggerUpdate(); |
55 |
@@ -995,14 +988,12 @@ void WpaGui::enableNetwork(const QString &sel) |
56 |
char reply[10]; |
57 |
size_t reply_len = sizeof(reply); |
58 |
|
59 |
- if (!cmd.startsWith("all")) { |
60 |
- int pos = cmd.indexOf(':'); |
61 |
- if (pos < 0) { |
62 |
- printf("Invalid enableNetwork '%s'\n", |
63 |
- cmd.toAscii().constData()); |
64 |
- return; |
65 |
- } |
66 |
- cmd.truncate(pos); |
67 |
+ if (cmd.contains(QRegExp("^\\d+:"))) |
68 |
+ cmd.truncate(cmd.indexOf(':')); |
69 |
+ else if (!cmd.startsWith("all")) { |
70 |
+ printf("Invalid editNetwork '%s'\n", |
71 |
+ cmd.toAscii().constData()); |
72 |
+ return; |
73 |
} |
74 |
cmd.prepend("ENABLE_NETWORK "); |
75 |
ctrlRequest(cmd.toAscii().constData(), reply, &reply_len); |
76 |
@@ -1016,14 +1007,12 @@ void WpaGui::disableNetwork(const QString &sel) |
77 |
char reply[10]; |
78 |
size_t reply_len = sizeof(reply); |
79 |
|
80 |
- if (!cmd.startsWith("all")) { |
81 |
- int pos = cmd.indexOf(':'); |
82 |
- if (pos < 0) { |
83 |
- printf("Invalid disableNetwork '%s'\n", |
84 |
- cmd.toAscii().constData()); |
85 |
- return; |
86 |
- } |
87 |
- cmd.truncate(pos); |
88 |
+ if (cmd.contains(QRegExp("^\\d+:"))) |
89 |
+ cmd.truncate(cmd.indexOf(':')); |
90 |
+ else if (!cmd.startsWith("all")) { |
91 |
+ printf("Invalid editNetwork '%s'\n", |
92 |
+ cmd.toAscii().constData()); |
93 |
+ return; |
94 |
} |
95 |
cmd.prepend("DISABLE_NETWORK "); |
96 |
ctrlRequest(cmd.toAscii().constData(), reply, &reply_len); |
97 |
@@ -1036,14 +1025,8 @@ void WpaGui::editNetwork(const QString &sel) |
98 |
QString cmd(sel); |
99 |
int id = -1; |
100 |
|
101 |
- if (!cmd.compare(tr("Select any network"))) { |
102 |
- int pos = sel.indexOf(':'); |
103 |
- if (pos < 0) { |
104 |
- printf("Invalid editNetwork '%s'\n", |
105 |
- cmd.toAscii().constData()); |
106 |
- return; |
107 |
- } |
108 |
- cmd.truncate(pos); |
109 |
+ if (cmd.contains(QRegExp("^\\d+:"))) { |
110 |
+ cmd.truncate(cmd.indexOf(':')); |
111 |
id = cmd.toInt(); |
112 |
} |
113 |
|
114 |
@@ -1114,17 +1097,12 @@ void WpaGui::removeNetwork(const QString &sel) |
115 |
char reply[10]; |
116 |
size_t reply_len = sizeof(reply); |
117 |
|
118 |
- if (cmd.compare(tr("Select any network"))) |
119 |
+ if (cmd.contains(QRegExp("^\\d+:"))) |
120 |
+ cmd.truncate(cmd.indexOf(':')); |
121 |
+ else if (!cmd.startsWith("all")) { |
122 |
+ printf("Invalid editNetwork '%s'\n", |
123 |
+ cmd.toAscii().constData()); |
124 |
return; |
125 |
- |
126 |
- if (!cmd.startsWith("all")) { |
127 |
- int pos = cmd.indexOf(':'); |
128 |
- if (pos < 0) { |
129 |
- printf("Invalid removeNetwork '%s'\n", |
130 |
- cmd.toAscii().constData()); |
131 |
- return; |
132 |
- } |
133 |
- cmd.truncate(pos); |
134 |
} |
135 |
cmd.prepend("REMOVE_NETWORK "); |
136 |
ctrlRequest(cmd.toAscii().constData(), reply, &reply_len); |