Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(335)

Side by Side Diff: src/url_canon_etc.cc

Issue 113514: bugfix: z is a letter too (Closed) Base URL: http://google-url.googlecode.com/svn/trunk/
Patch Set: Created 11 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2007, Google Inc. 1 // Copyright 2007, Google Inc.
2 // All rights reserved. 2 // All rights reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // * Redistributions of source code must retain the above copyright 8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer. 9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above 10 // * Redistributions in binary form must reproduce the above
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 0, 0 , 0, 0 , 0, 95 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 0, 0 , 0, 0 , 0,
96 // ` a b c d e f g h i j k l m n o 96 // ` a b c d e f g h i j k l m n o
97 0 , 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', ' o', 97 0 , 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', ' o',
98 // p q r s t u v w x y z { | } ~ 98 // p q r s t u v w x y z { | } ~
99 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 0 , 0 , 0 , 0 , 0 }; 99 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 0 , 0 , 0 , 0 , 0 };
100 100
101 // This could be a table lookup as well by setting the high bit for each 101 // This could be a table lookup as well by setting the high bit for each
102 // valid character, but it's only called once per URL, and it makes the lookup 102 // valid character, but it's only called once per URL, and it makes the lookup
103 // table easier to read not having extra stuff in it. 103 // table easier to read not having extra stuff in it.
104 inline bool IsSchemeFirstChar(unsigned char c) { 104 inline bool IsSchemeFirstChar(unsigned char c) {
105 return (c >= 'a' && c < 'z') || (c >= 'A' && c < 'Z'); 105 return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
106 } 106 }
107 107
108 template<typename CHAR, typename UCHAR> 108 template<typename CHAR, typename UCHAR>
109 bool DoScheme(const CHAR* spec, 109 bool DoScheme(const CHAR* spec,
110 const url_parse::Component& scheme, 110 const url_parse::Component& scheme,
111 CanonOutput* output, 111 CanonOutput* output,
112 url_parse::Component* out_scheme) { 112 url_parse::Component* out_scheme) {
113 if (scheme.len <= 0) { 113 if (scheme.len <= 0) {
114 // Scheme is unspecified or empty, convert to empty by appending a colon. 114 // Scheme is unspecified or empty, convert to empty by appending a colon.
115 *out_scheme = url_parse::Component(output->length(), 0); 115 *out_scheme = url_parse::Component(output->length(), 0);
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 } 382 }
383 383
384 void CanonicalizeRef(const char16* spec, 384 void CanonicalizeRef(const char16* spec,
385 const url_parse::Component& ref, 385 const url_parse::Component& ref,
386 CanonOutput* output, 386 CanonOutput* output,
387 url_parse::Component* out_ref) { 387 url_parse::Component* out_ref) {
388 DoCanonicalizeRef<char16, char16>(spec, ref, output, out_ref); 388 DoCanonicalizeRef<char16, char16>(spec, ref, output, out_ref);
389 } 389 }
390 390
391 } // namespace url_canon 391 } // namespace url_canon
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698