-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0001-REBASE-CLEANUP-for-merge-with-730ab3937cc3d8d978b5.patch
132 lines (115 loc) · 3.76 KB
/
0001-REBASE-CLEANUP-for-merge-with-730ab3937cc3d8d978b5.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
From d15379c31d9437ecf3bf390379663b17bd4ea28b Mon Sep 17 00:00:00 2001
From: Slava Zanko <slavazanko@gmail.com>
Date: Fri, 27 Nov 2009 12:54:25 +0200
Subject: [PATCH] REBASE: CLEANUP: for merge with 730ab3937cc3d8d978b51829bfa6ced71d2bd660
run command:
git rebase -i 730ab3937cc3d8d978b51829bfa6ced71d2bd660^
and split this commit with 730ab3937cc3d
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
---
src/ext.c | 63 +++++++++++++++++++++++++++++-------------------------------
1 files changed, 30 insertions(+), 33 deletions(-)
diff --git a/src/ext.c b/src/ext.c
index b9ed2d7..771f85a 100644
--- a/src/ext.c
+++ b/src/ext.c
@@ -300,7 +300,7 @@ exec_extension (const char *filename, const char *lc_data, int *move_dir,
# define FILE_CMD "file "
#endif
-/*
+/*
* Run cmd_file with args, put in buf[buflen] result.
* If error, put in buf[0] = '\0';
*
@@ -326,17 +326,17 @@ get_popen_information(const char *cmd_file, const char *args, char *buf, int bu
read_bytes = (fgets (buf, buflen, f)
!= NULL);
if (read_bytes == 0)
- /* if(buflen > 0) // ;-) */
- buf[0] = 0;
+/* if(buflen > 0) // ;-) */
+ buf[0] = 0;
pclose (f);
- } else {
- /* if(buflen > 0) // ;-) */
+ } else {
+/* if(buflen > 0) // ;-) */
buf[0] = 0; /* Paranoid termination */
return -1;
}
-
+
/* Paranoid termination */
- buf[buflen - 1] = 0;
+ buf[buflen - 1] = 0;
return (read_bytes > 0);
}
@@ -361,19 +361,18 @@ get_file_type_local (const char *filename, char *buf, int buflen)
static int
get_file_encoding_local (const char *filename, char *buf, int buflen)
{
- if(autodetect_codeset[0] != '\0')
- {
- int read_bytes = 0;
- char *tmp = name_quote (filename, 0);
- char *lang = name_quote (autodetect_codeset, 0);
- char *args= g_strconcat (" -L", lang, " -i ", tmp, (char *) 0);
- int ret = get_popen_information("enca", args, buf, buflen);
- g_free (args);
- g_free (lang);
- g_free (tmp);
- return ret;
+ if(autodetect_codeset[0] != '\0') {
+ int read_bytes = 0;
+ char *tmp = name_quote (filename, 0);
+ char *lang = name_quote (autodetect_codeset, 0);
+ char *args= g_strconcat (" -L", lang, " -i ", tmp, (char *) 0);
+ int ret = get_popen_information("enca", args, buf, buflen);
+ g_free (args);
+ g_free (lang);
+ g_free (tmp);
+ return ret;
}
- return 0;
+ return 0;
}
@@ -390,7 +389,7 @@ regex_check_type (const char *filename, const char *ptr, int *have_type)
/* Following variables are valid if *have_type is 1 */
static char content_string[2048];
- static char encoding_id[21]; // CSISO51INISCYRILLIC -- 20
+ static char encoding_id[21]; /* CSISO51INISCYRILLIC -- 20 */
static int got_encoding_data = 0;
static int content_shift = 0;
static int got_data = 0;
@@ -411,24 +410,22 @@ regex_check_type (const char *filename, const char *ptr, int *have_type)
realname = localfile;
- got_encoding_data =
- get_file_encoding_local (localfile, encoding_id,
+ got_encoding_data =
+ get_file_encoding_local (localfile, encoding_id,
sizeof (encoding_id));
mc_ungetlocalcopy (filename, localfile, 0);
- if( got_encoding_data > 0 )
- {
- char *pp;
- if ((pp = strchr (encoding_id, '\n')) != 0)
- *pp = 0;
+ if( got_encoding_data > 0 ) {
+ char *pp;
+ if ((pp = strchr (encoding_id, '\n')) != 0)
+ *pp = 0;
- source_codepage = get_codepage_index( encoding_id );
- if(source_codepage == -1)
- source_codepage = default_source_codepage;
- }
+ source_codepage = get_codepage_index( encoding_id );
+ if(source_codepage == -1)
+ source_codepage = default_source_codepage;
+ }
-
- got_data =
+ got_data =
get_file_type_local (localfile, content_string,
sizeof (content_string));
--
1.6.0.3