OLD | NEW |
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | 1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 /* ***** BEGIN LICENSE BLOCK ***** | 2 /* ***** BEGIN LICENSE BLOCK ***** |
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
4 * | 4 * |
5 * The contents of this file are subject to the Mozilla Public License Version | 5 * The contents of this file are subject to the Mozilla Public License Version |
6 * 1.1 (the "License"); you may not use this file except in compliance with | 6 * 1.1 (the "License"); you may not use this file except in compliance with |
7 * the License. You may obtain a copy of the License at | 7 * the License. You may obtain a copy of the License at |
8 * http://www.mozilla.org/MPL/ | 8 * http://www.mozilla.org/MPL/ |
9 * | 9 * |
10 * Software distributed under the License is distributed on an "AS IS" basis, | 10 * Software distributed under the License is distributed on an "AS IS" basis, |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 ++idx; | 215 ++idx; |
216 | 216 |
217 std::string value = MorkUnescape( | 217 std::string value = MorkUnescape( |
218 std::string(&line[token_start], token_end - token_start)); | 218 std::string(&line[token_start], token_end - token_start)); |
219 (*map)[key] = value; | 219 (*map)[key] = value; |
220 key.clear(); | 220 key.clear(); |
221 break; | 221 break; |
222 } | 222 } |
223 case '>': | 223 case '>': |
224 // End of the map. | 224 // End of the map. |
225 DLOG_IF(WARNING, key.empty()) << | 225 DLOG_IF(WARNING, !key.empty()) << |
226 "map terminates inside of key/value pair"; | 226 "map terminates inside of key/value pair"; |
227 return true; | 227 return true; |
228 } | 228 } |
229 } | 229 } |
230 | 230 |
231 // We should start reading the next line at the beginning. | 231 // We should start reading the next line at the beginning. |
232 start_index = 0; | 232 start_index = 0; |
233 } while (ReadLine(&line)); | 233 } while (ReadLine(&line)); |
234 | 234 |
235 // We ran out of lines and the map never terminated. This probably indicates | 235 // We ran out of lines and the map never terminated. This probably indicates |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 data.swap_bytes = (byte_order_value == "BE"); | 578 data.swap_bytes = (byte_order_value == "BE"); |
579 } | 579 } |
580 } | 580 } |
581 | 581 |
582 history::URLRows rows; | 582 history::URLRows rows; |
583 for (MorkReader::iterator i = reader.begin(); i != reader.end(); ++i) | 583 for (MorkReader::iterator i = reader.begin(); i != reader.end(); ++i) |
584 AddToHistory(i->second, data, &rows); | 584 AddToHistory(i->second, data, &rows); |
585 if (!rows.empty()) | 585 if (!rows.empty()) |
586 bridge->SetHistoryItems(rows, history::SOURCE_FIREFOX_IMPORTED); | 586 bridge->SetHistoryItems(rows, history::SOURCE_FIREFOX_IMPORTED); |
587 } | 587 } |
OLD | NEW |