updated on Tue Jan 10 04:01:21 UTC 2012
[aur-mirror.git] / newspost / getline.patch
blob3aec6e1037678f2971d03215479b57e43481275d
1 diff -crB newspost-2.1.1.org/base/newspost.c newspost-2.1.1/base/newspost.c
2 *** newspost-2.1.1.org/base/newspost.c 2003-04-23 17:33:23.000000000 +0200
3 --- newspost-2.1.1/base/newspost.c 2009-12-29 20:18:19.000000000 +0100
4 ***************
5 *** 342,348 ****
6 file = fopen(filename, "r");
7 if (file != NULL) {
8 while (!feof(file)) {
9 ! line = getline(line, file);
10 if(line == NULL){
11 text_buffer = buff_add(text_buffer, "\r\n");
12 continue;
13 --- 342,348 ----
14 file = fopen(filename, "r");
15 if (file != NULL) {
16 while (!feof(file)) {
17 ! line = get_line(line, file);
18 if(line == NULL){
19 text_buffer = buff_add(text_buffer, "\r\n");
20 continue;
21 diff -crB newspost-2.1.1.org/base/utils.c newspost-2.1.1/base/utils.c
22 *** newspost-2.1.1.org/base/utils.c 2003-04-23 17:33:23.000000000 +0200
23 --- newspost-2.1.1/base/utils.c 2009-12-29 20:18:34.000000000 +0100
24 ***************
25 *** 43,49 ****
26 return NULL;
29 ! Buff * getline(Buff *buff, FILE *file){
30 char c = fgetc(file);
31 buff = buff_free(buff);
32 while(TRUE){
33 --- 43,49 ----
34 return NULL;
37 ! Buff * get_line(Buff *buff, FILE *file){
38 char c = fgetc(file);
39 buff = buff_free(buff);
40 while(TRUE){
41 diff -crB newspost-2.1.1.org/base/utils.h newspost-2.1.1/base/utils.h
42 *** newspost-2.1.1.org/base/utils.h 2003-02-08 16:09:41.000000000 +0100
43 --- newspost-2.1.1/base/utils.h 2009-12-29 20:18:45.000000000 +0100
44 ***************
45 *** 26,32 ****
46 file_entry * file_entry_alloc();
47 file_entry * file_entry_free(file_entry *fe);
49 ! Buff * getline(Buff *buff, FILE *file);
50 Buff *buff_add(Buff *buff, char *data, ... );
51 Buff * buff_free(Buff *buff);
52 Buff *buff_create(Buff *buff, char *data, ... );
53 --- 26,32 ----
54 file_entry * file_entry_alloc();
55 file_entry * file_entry_free(file_entry *fe);
57 ! Buff * get_line(Buff *buff, FILE *file);
58 Buff *buff_add(Buff *buff, char *data, ... );
59 Buff * buff_free(Buff *buff);
60 Buff *buff_create(Buff *buff, char *data, ... );
61 diff -crB newspost-2.1.1.org/ui/options.c newspost-2.1.1/ui/options.c
62 *** newspost-2.1.1.org/ui/options.c 2003-04-23 17:33:33.000000000 +0200
63 --- newspost-2.1.1/ui/options.c 2009-12-29 20:19:06.000000000 +0100
64 ***************
65 *** 332,338 ****
66 file = fopen(filename->data, "r");
67 if (file != NULL) {
68 while (!feof(file)) {
69 ! line = getline(line, file);
70 linenum++;
71 if(line == NULL) continue;
73 --- 332,338 ----
74 file = fopen(filename->data, "r");
75 if (file != NULL) {
76 while (!feof(file)) {
77 ! line = get_line(line, file);
78 linenum++;
79 if(line == NULL) continue;
81 ***************
82 *** 429,435 ****
83 linenum = 0;
84 while (linenum < 8) {
85 linenum++;
86 ! line = getline(line, file);
87 if(line == NULL) continue;
89 switch (linenum) {
90 --- 429,435 ----
91 linenum = 0;
92 while (linenum < 8) {
93 linenum++;
94 ! line = get_line(line, file);
95 if(line == NULL) continue;
97 switch (linenum) {