intl/icu/source/common/cwchar.c

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1 /*
michael@0 2 ******************************************************************************
michael@0 3 *
michael@0 4 * Copyright (C) 2001, International Business Machines
michael@0 5 * Corporation and others. All Rights Reserved.
michael@0 6 *
michael@0 7 ******************************************************************************
michael@0 8 * file name: cwchar.c
michael@0 9 * encoding: US-ASCII
michael@0 10 * tab size: 8 (not used)
michael@0 11 * indentation:4
michael@0 12 *
michael@0 13 * created on: 2001may25
michael@0 14 * created by: Markus W. Scherer
michael@0 15 */
michael@0 16
michael@0 17 #include "unicode/utypes.h"
michael@0 18
michael@0 19 #if !U_HAVE_WCSCPY
michael@0 20
michael@0 21 #include "cwchar.h"
michael@0 22
michael@0 23 U_CAPI wchar_t *uprv_wcscat(wchar_t *dst, const wchar_t *src) {
michael@0 24 wchar_t *start=dst;
michael@0 25 while(*dst!=0) {
michael@0 26 ++dst;
michael@0 27 }
michael@0 28 while((*dst=*src)!=0) {
michael@0 29 ++dst;
michael@0 30 ++src;
michael@0 31 }
michael@0 32 return start;
michael@0 33 }
michael@0 34
michael@0 35 U_CAPI wchar_t *uprv_wcscpy(wchar_t *dst, const wchar_t *src) {
michael@0 36 wchar_t *start=dst;
michael@0 37 while((*dst=*src)!=0) {
michael@0 38 ++dst;
michael@0 39 ++src;
michael@0 40 }
michael@0 41 return start;
michael@0 42 }
michael@0 43
michael@0 44 U_CAPI size_t uprv_wcslen(const wchar_t *src) {
michael@0 45 const wchar_t *start=src;
michael@0 46 while(*src!=0) {
michael@0 47 ++src;
michael@0 48 }
michael@0 49 return src-start;
michael@0 50 }
michael@0 51
michael@0 52 #endif
michael@0 53

mercurial