17 |
|
{ |
18 |
|
if (config.hosts.count(host) < 2) |
19 |
|
{ |
20 |
< |
cerr << program << ": No configuration for " << host << "\n"; |
20 |
> |
cerr << program << ": No configuration for host: " << host << "\n"; |
21 |
|
exit(1); |
22 |
|
} |
23 |
|
|
26 |
|
itor++) |
27 |
|
{ |
28 |
|
string entry = itor->second; |
29 |
< |
|
29 |
> |
|
30 |
|
if (entry.find("passwd=") == 0) |
31 |
|
{ |
32 |
< |
// |
32 |
> |
istringstream sin(entry.substr(7)); |
33 |
> |
|
34 |
> |
do |
35 |
> |
{ |
36 |
> |
string item; |
37 |
> |
getline(sin, item, ','); |
38 |
> |
|
39 |
> |
if (item == "file") |
40 |
> |
{ |
41 |
> |
passwd.push_back(file); |
42 |
> |
} |
43 |
> |
else if (item == "prompt") |
44 |
> |
{ |
45 |
> |
passwd.push_back(prompt); |
46 |
> |
} |
47 |
> |
} |
48 |
> |
while (sin.good()); |
49 |
|
} |
50 |
|
else if (entry.find("folder=") == 0) |
51 |
|
{ |
52 |
< |
// |
52 |
> |
istringstream sin(entry.substr(7)); |
53 |
> |
|
54 |
> |
string folder; |
55 |
> |
getline(sin, folder, ':'); |
56 |
> |
|
57 |
> |
string local; |
58 |
> |
getline(sin, local, ':'); |
59 |
> |
|
60 |
> |
string remote; |
61 |
> |
getline(sin, remote); |
62 |
> |
|
63 |
> |
if (folder == "*") |
64 |
> |
{ |
65 |
> |
regular.local = local; |
66 |
> |
regular.remote = remote; |
67 |
> |
} |
68 |
> |
else |
69 |
> |
{ |
70 |
> |
Folder special; |
71 |
> |
|
72 |
> |
special.local = local; |
73 |
> |
special.remote = remote; |
74 |
> |
|
75 |
> |
folders.insert(pair<string, Folder>(folder, special)); |
76 |
> |
} |
77 |
|
} |
78 |
|
else |
79 |
|
{ |
80 |
< |
cerr << program << ": Unknown configuration " << entry |
81 |
< |
<< ", ignored\n"; |
80 |
> |
cerr << program << ": Unknown configuration entry: \"" << entry |
81 |
> |
<< "\", ignored\n"; |
82 |
|
} |
83 |
|
} |
84 |
|
} |