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

Unified Diff: nspr/pr/src/io/prstdio.c

Issue 2078763002: Delete bundled copy of NSS and replace with README. (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/nss@master
Patch Set: Delete bundled copy of NSS and replace with README. Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « nspr/pr/src/io/prsocket.c ('k') | nspr/pr/src/linking/prlink.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: nspr/pr/src/io/prstdio.c
diff --git a/nspr/pr/src/io/prstdio.c b/nspr/pr/src/io/prstdio.c
deleted file mode 100644
index 74b85d9cf175850c56ba085bced53e8902757931..0000000000000000000000000000000000000000
--- a/nspr/pr/src/io/prstdio.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "primpl.h"
-
-#include <string.h>
-
-/*
-** fprintf to a PRFileDesc
-*/
-PR_IMPLEMENT(PRUint32) PR_fprintf(PRFileDesc* fd, const char *fmt, ...)
-{
- va_list ap;
- PRUint32 rv;
-
- va_start(ap, fmt);
- rv = PR_vfprintf(fd, fmt, ap);
- va_end(ap);
- return rv;
-}
-
-PR_IMPLEMENT(PRUint32) PR_vfprintf(PRFileDesc* fd, const char *fmt, va_list ap)
-{
- /* XXX this could be better */
- PRUint32 rv, len;
- char* msg = PR_vsmprintf(fmt, ap);
- if (NULL == msg) {
- return -1;
- }
- len = strlen(msg);
-#ifdef XP_OS2
- /*
- * OS/2 really needs a \r for every \n.
- * In the future we should try to use scatter-gather instead of a
- * succession of PR_Write.
- */
- if (isatty(PR_FileDesc2NativeHandle(fd))) {
- PRUint32 last = 0, idx;
- PRInt32 tmp;
- rv = 0;
- for (idx = 0; idx < len+1; idx++) {
- if ((idx - last > 0) && (('\n' == msg[idx]) || (idx == len))) {
- tmp = PR_Write(fd, msg + last, idx - last);
- if (tmp >= 0) {
- rv += tmp;
- }
- last = idx;
- }
- /*
- * if current character is \n, and
- * previous character isn't \r, and
- * next character isn't \r
- */
- if (('\n' == msg[idx]) &&
- ((0 == idx) || ('\r' != msg[idx-1])) &&
- ('\r' != msg[idx+1])) {
- /* add extra \r */
- tmp = PR_Write(fd, "\r", 1);
- if (tmp >= 0) {
- rv += tmp;
- }
- }
- }
- } else {
- rv = PR_Write(fd, msg, len);
- }
-#else
- rv = PR_Write(fd, msg, len);
-#endif
- PR_DELETE(msg);
- return rv;
-}
« no previous file with comments | « nspr/pr/src/io/prsocket.c ('k') | nspr/pr/src/linking/prlink.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698