@@ -135,30 +135,30 @@ static void rm_cmd_show_manpage(void) {
135
135
* We try to work around this by manually installing dist-packages to the
136
136
* sys.path by first calling a small bootstrap script.
137
137
*/
138
- static const char RM_PY_BOOTSTRAP [] =
138
+ static const char rm_py_bootstrap [] =
139
139
""
140
- "# This is a bootstrap script for the rmlint-gui. \n"
141
- "# See the src/rmlint .c in rmlint's source for more info. \n"
142
- "import sys, os, site \n"
143
- " \n"
144
- "# Also default to dist-packages on debian(-based): \n"
145
- "sites = site.getsitepackages() \n"
146
- "sys.path.extend([d.replace('dist-packages', 'site-packages') for d in sites]) \n"
147
- "sys.path.extend(sites) \n"
148
- " \n"
149
- "# Cleanup self: \n"
150
- "try: \n"
151
- " os.remove(sys.argv[0]) \n"
152
- "except: \n"
153
- " print('Note: Could not remove bootstrap script at ', sys.argv[0]) \n"
154
- " \n"
155
- "# Run shredder by importing the main: \n"
156
- "try: \n"
157
- " import shredder \n"
158
- " shredder.run_gui() \n"
159
- "except ImportError as err: \n"
160
- " print('Failed to load shredder:', err) \n"
161
- " print('This might be due to a corrupted install; try reinstalling.') \n" ;
140
+ "# This is a bootstrap script for rmlint-gui (aka Shredder) \n"
141
+ "# See the lib/cmdline .c in rmlint's source for more info.\n"
142
+ "import sys, os, site\n"
143
+ "\n"
144
+ "# Also default to dist-packages on debian(-based):\n"
145
+ "sites = site.getsitepackages()\n"
146
+ "sys.path.extend([d.replace('dist-packages', 'site-packages') for d in sites])\n"
147
+ "sys.path.extend(sites)\n"
148
+ "\n"
149
+ "# Cleanup self:\n"
150
+ "try:\n"
151
+ " os.remove(sys.argv[0])\n"
152
+ "except:\n"
153
+ " print('Note: Could not remove bootstrap script at ', sys.argv[0])\n"
154
+ "\n"
155
+ "# Run shredder: \n"
156
+ "try:\n"
157
+ " import shredder\n"
158
+ " shredder.run_gui()\n"
159
+ "except ImportError as err:\n"
160
+ " print('Failed to load shredder:', err)\n"
161
+ " print('This might be due to a corrupted install; try reinstalling.')\n" ;
162
162
163
163
static void rm_cmd_start_gui (int argc , const char * * argv ) {
164
164
const char * commands [] = {"python3" , "python" , NULL };
@@ -176,7 +176,7 @@ static void rm_cmd_start_gui(int argc, const char **argv) {
176
176
return ;
177
177
}
178
178
179
- if (write (bootstrap_fd , RM_PY_BOOTSTRAP , strlen ( RM_PY_BOOTSTRAP ) ) < 0 ) {
179
+ if (write (bootstrap_fd , rm_py_bootstrap , sizeof ( rm_py_bootstrap ) - 1 ) < 0 ) {
180
180
rm_log_warning_line ("Could not bootstrap gui: Unable to write to tempfile: %s" ,
181
181
g_strerror (errno ));
182
182
return ;
0 commit comments