The R Project SVN R

Rev

Rev 83709 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 83709 Rev 88761
Line 1... Line 1...
1
/*
1
/*
2
 *  R : A Computer Language for Statistical Data Analysis
2
 *  R : A Computer Language for Statistical Data Analysis
3
 *  file pager.c
3
 *  file pager.c
4
 *  Copyright (C) 1998--2002  Guido Masarotto and Brian Ripley
4
 *  Copyright (C) 1998--2002  Guido Masarotto and Brian Ripley
5
 *  Copyright (C) 2004--8     The R Foundation
5
 *  Copyright (C) 2004--8     The R Foundation
6
 *  Copyright (C) 2004--2023  The R Core Team
6
 *  Copyright (C) 2004--2025  The R Core Team
7
 *
7
 *
8
 *  This program is free software; you can redistribute it and/or modify
8
 *  This program is free software; you can redistribute it and/or modify
9
 *  it under the terms of the GNU General Public License as published by
9
 *  it under the terms of the GNU General Public License as published by
10
 *  the Free Software Foundation; either version 2 of the License, or
10
 *  the Free Software Foundation; either version 2 of the License, or
11
 *  (at your option) any later version.
11
 *  (at your option) any later version.
Line 110... Line 110...
110
    CloseHandle(f);
110
    CloseHandle(f);
111
    if (del) DeleteFile(name);
111
    if (del) DeleteFile(name);
112
    p[rr] = '\0';
112
    p[rr] = '\0';
113
    cnt = mbstowcs(NULL, p, 0);
113
    cnt = mbstowcs(NULL, p, 0);
114
    wp = (wchar_t *) malloc((cnt+1) * sizeof(wchar_t));
114
    wp = (wchar_t *) malloc((cnt+1) * sizeof(wchar_t));
-
 
115
    if (!wp) {
-
 
116
	R_ShowMessage(G_("Insufficient memory to display file in internal pager"));
-
 
117
	return NULL;
-
 
118
    }
115
    mbstowcs(wp, p, cnt+1);
119
    mbstowcs(wp, p, cnt+1);
116
    for (q = wp, ms = 1, dim = cnt; *q; q++) {
120
    for (q = wp, ms = 1, dim = cnt; *q; q++) {
117
	if (*q == '\t')
121
	if (*q == '\t')
118
	    dim += TABSIZE;
122
	    dim += TABSIZE;
119
	else if (*q == '\n') {
123
	else if (*q == '\n') {