author | Myhailo Danylenko <isbear@ukrpost.net> |
Tue, 03 May 2011 02:30:09 +0300 | |
changeset 20 | 366078a16d85 |
parent 18 | 962e2fc6a708 |
child 21 | 8b61328ab7c1 |
permissions | -rw-r--r-- |
0 | 1 |
/* |
2 |
* env.c -- Tampering with mcabber's environment |
|
3 |
* |
|
4 |
* Copyrigth (C) 2009 Myhailo Danylenko <isbear@ukrpost.net> |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or modify |
|
7 |
* it under the terms of the GNU General Public License as published by |
|
8 |
* the Free Software Foundation; either version 2 of the License, or (at |
|
9 |
* your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, but |
|
12 |
* WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
14 |
* General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
|
19 |
* USA |
|
20 |
*/ |
|
21 |
||
22 |
#include <glib.h> |
|
23 |
#include <string.h> |
|
24 |
#include <stdlib.h> |
|
3 | 25 |
#include <unistd.h> |
26 |
#include <errno.h> |
|
0 | 27 |
|
14
61d94594e8fb
Fix compilation warnings
Myhailo Danylenko <isbear@ukrpost.net>
parents:
13
diff
changeset
|
28 |
#include <mcabber/commands.h> |
5
da2fdd072650
Change mcabber headers naming scheme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
4
diff
changeset
|
29 |
#include <mcabber/utils.h> |
da2fdd072650
Change mcabber headers naming scheme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
4
diff
changeset
|
30 |
#include <mcabber/compl.h> |
da2fdd072650
Change mcabber headers naming scheme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
4
diff
changeset
|
31 |
#include <mcabber/logprint.h> |
11
dc7bcc0fa5e1
New module loading scheme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
5
diff
changeset
|
32 |
#include <mcabber/modules.h> |
dc7bcc0fa5e1
New module loading scheme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
5
diff
changeset
|
33 |
|
12
14cd74b518ea
Use new module struct with apis
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
34 |
#include "config.h" |
14cd74b518ea
Use new module struct with apis
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
35 |
|
11
dc7bcc0fa5e1
New module loading scheme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
5
diff
changeset
|
36 |
static void env_load (void); |
dc7bcc0fa5e1
New module loading scheme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
5
diff
changeset
|
37 |
static void env_unload (void); |
dc7bcc0fa5e1
New module loading scheme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
5
diff
changeset
|
38 |
|
12
14cd74b518ea
Use new module struct with apis
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
39 |
#define DESCRIPTION ( "Some debugging routines\nProvides commands /env and /cd" ) |
14cd74b518ea
Use new module struct with apis
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
40 |
|
14cd74b518ea
Use new module struct with apis
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
41 |
static module_info_t info_env_experimental = { |
14cd74b518ea
Use new module struct with apis
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
42 |
.branch = "experimental", |
18
962e2fc6a708
Add info struct for stable
Myhailo Danylenko <isbear@ukrpost.net>
parents:
17
diff
changeset
|
43 |
.api = 28, |
962e2fc6a708
Add info struct for stable
Myhailo Danylenko <isbear@ukrpost.net>
parents:
17
diff
changeset
|
44 |
.version = PROJECT_VERSION, |
962e2fc6a708
Add info struct for stable
Myhailo Danylenko <isbear@ukrpost.net>
parents:
17
diff
changeset
|
45 |
.description = DESCRIPTION, |
962e2fc6a708
Add info struct for stable
Myhailo Danylenko <isbear@ukrpost.net>
parents:
17
diff
changeset
|
46 |
.requires = NULL, |
962e2fc6a708
Add info struct for stable
Myhailo Danylenko <isbear@ukrpost.net>
parents:
17
diff
changeset
|
47 |
.init = env_load, |
962e2fc6a708
Add info struct for stable
Myhailo Danylenko <isbear@ukrpost.net>
parents:
17
diff
changeset
|
48 |
.uninit = env_unload, |
962e2fc6a708
Add info struct for stable
Myhailo Danylenko <isbear@ukrpost.net>
parents:
17
diff
changeset
|
49 |
.next = NULL, |
962e2fc6a708
Add info struct for stable
Myhailo Danylenko <isbear@ukrpost.net>
parents:
17
diff
changeset
|
50 |
}; |
962e2fc6a708
Add info struct for stable
Myhailo Danylenko <isbear@ukrpost.net>
parents:
17
diff
changeset
|
51 |
|
962e2fc6a708
Add info struct for stable
Myhailo Danylenko <isbear@ukrpost.net>
parents:
17
diff
changeset
|
52 |
static module_info_t info_env_dev = { |
962e2fc6a708
Add info struct for stable
Myhailo Danylenko <isbear@ukrpost.net>
parents:
17
diff
changeset
|
53 |
.branch = "dev", |
962e2fc6a708
Add info struct for stable
Myhailo Danylenko <isbear@ukrpost.net>
parents:
17
diff
changeset
|
54 |
.api = 13, |
12
14cd74b518ea
Use new module struct with apis
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
55 |
.version = PROJECT_VERSION, |
14cd74b518ea
Use new module struct with apis
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
56 |
.description = DESCRIPTION, |
14cd74b518ea
Use new module struct with apis
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
57 |
.requires = NULL, |
14cd74b518ea
Use new module struct with apis
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
58 |
.init = env_load, |
14cd74b518ea
Use new module struct with apis
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
59 |
.uninit = env_unload, |
14cd74b518ea
Use new module struct with apis
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
60 |
.next = &info_env_experimental, |
14cd74b518ea
Use new module struct with apis
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
61 |
}; |
14cd74b518ea
Use new module struct with apis
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
62 |
|
11
dc7bcc0fa5e1
New module loading scheme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
5
diff
changeset
|
63 |
module_info_t info_env = { |
18
962e2fc6a708
Add info struct for stable
Myhailo Danylenko <isbear@ukrpost.net>
parents:
17
diff
changeset
|
64 |
.branch = "0.10.0", |
962e2fc6a708
Add info struct for stable
Myhailo Danylenko <isbear@ukrpost.net>
parents:
17
diff
changeset
|
65 |
.api = 1, |
12
14cd74b518ea
Use new module struct with apis
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
66 |
.version = PROJECT_VERSION, |
14cd74b518ea
Use new module struct with apis
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
67 |
.description = DESCRIPTION, |
14cd74b518ea
Use new module struct with apis
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
68 |
.requires = NULL, |
14cd74b518ea
Use new module struct with apis
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
69 |
.init = env_load, |
14cd74b518ea
Use new module struct with apis
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
70 |
.uninit = env_unload, |
18
962e2fc6a708
Add info struct for stable
Myhailo Danylenko <isbear@ukrpost.net>
parents:
17
diff
changeset
|
71 |
.next = &info_env_dev, |
11
dc7bcc0fa5e1
New module loading scheme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
5
diff
changeset
|
72 |
}; |
0 | 73 |
|
16
543bd8927354
Use new commands interface
Myhailo Danylenko <isbear@ukrpost.net>
parents:
15
diff
changeset
|
74 |
#ifdef HAVE_CMD_ID |
543bd8927354
Use new commands interface
Myhailo Danylenko <isbear@ukrpost.net>
parents:
15
diff
changeset
|
75 |
static gpointer env_env_cmid = NULL; |
543bd8927354
Use new commands interface
Myhailo Danylenko <isbear@ukrpost.net>
parents:
15
diff
changeset
|
76 |
static gpointer env_cd_cmid = NULL; |
543bd8927354
Use new commands interface
Myhailo Danylenko <isbear@ukrpost.net>
parents:
15
diff
changeset
|
77 |
#ifdef HAVE_CMD_SAFE |
543bd8927354
Use new commands interface
Myhailo Danylenko <isbear@ukrpost.net>
parents:
15
diff
changeset
|
78 |
static gboolean env_env_set_safe = FALSE; |
543bd8927354
Use new commands interface
Myhailo Danylenko <isbear@ukrpost.net>
parents:
15
diff
changeset
|
79 |
static gboolean env_cd_set_safe = FALSE; |
543bd8927354
Use new commands interface
Myhailo Danylenko <isbear@ukrpost.net>
parents:
15
diff
changeset
|
80 |
#endif |
543bd8927354
Use new commands interface
Myhailo Danylenko <isbear@ukrpost.net>
parents:
15
diff
changeset
|
81 |
#endif |
543bd8927354
Use new commands interface
Myhailo Danylenko <isbear@ukrpost.net>
parents:
15
diff
changeset
|
82 |
|
0 | 83 |
extern char **environ; |
84 |
||
4
2c5225ab6eb7
Changed command syntax to allow unsetting
Myhailo Danylenko <isbear@ukrpost.net>
parents:
3
diff
changeset
|
85 |
// /env [option [= [value]]] |
0 | 86 |
static void do_env (char *arg) |
87 |
{ |
|
4
2c5225ab6eb7
Changed command syntax to allow unsetting
Myhailo Danylenko <isbear@ukrpost.net>
parents:
3
diff
changeset
|
88 |
if (!*arg) { |
0 | 89 |
// print full variables list |
90 |
GSList *vars = NULL; |
|
91 |
int max = 0; |
|
92 |
||
93 |
{ |
|
94 |
char **envvar; |
|
95 |
||
96 |
for (envvar = environ; *envvar; ++envvar) { |
|
97 |
char *end = strchr (*envvar, '='); |
|
98 |
||
99 |
if (end) { |
|
100 |
int len = end - *envvar; |
|
101 |
char *name = g_strndup (*envvar, len); |
|
102 |
||
103 |
if (len > max) |
|
104 |
max = len; |
|
105 |
||
106 |
vars = g_slist_prepend (vars, name); |
|
107 |
} |
|
108 |
} |
|
109 |
} |
|
110 |
||
111 |
if (max) { |
|
4
2c5225ab6eb7
Changed command syntax to allow unsetting
Myhailo Danylenko <isbear@ukrpost.net>
parents:
3
diff
changeset
|
112 |
gchar *format = g_strdup_printf ("Env %%-%ds = %%s", max); |
0 | 113 |
GSList *eel; |
114 |
||
115 |
vars = g_slist_sort (vars, (GCompareFunc) strcmp); |
|
116 |
||
117 |
for (eel = vars; eel; eel = eel->next) { |
|
118 |
char *name = (char *) eel->data; |
|
119 |
char *value = getenv (name); |
|
120 |
||
13
dbb001e9f800
Use new scr_* functions
Myhailo Danylenko <isbear@ukrpost.net>
parents:
12
diff
changeset
|
121 |
scr_log_print (LPRINT_NORMAL, format, name, value); |
0 | 122 |
|
123 |
g_free (name); |
|
124 |
} |
|
125 |
||
126 |
g_free (format); |
|
127 |
} |
|
128 |
||
129 |
g_slist_free (vars); |
|
130 |
||
4
2c5225ab6eb7
Changed command syntax to allow unsetting
Myhailo Danylenko <isbear@ukrpost.net>
parents:
3
diff
changeset
|
131 |
} else { |
2c5225ab6eb7
Changed command syntax to allow unsetting
Myhailo Danylenko <isbear@ukrpost.net>
parents:
3
diff
changeset
|
132 |
|
2c5225ab6eb7
Changed command syntax to allow unsetting
Myhailo Danylenko <isbear@ukrpost.net>
parents:
3
diff
changeset
|
133 |
char *varend = strchr (arg, '='); |
2c5225ab6eb7
Changed command syntax to allow unsetting
Myhailo Danylenko <isbear@ukrpost.net>
parents:
3
diff
changeset
|
134 |
|
2c5225ab6eb7
Changed command syntax to allow unsetting
Myhailo Danylenko <isbear@ukrpost.net>
parents:
3
diff
changeset
|
135 |
if (!varend) { |
2c5225ab6eb7
Changed command syntax to allow unsetting
Myhailo Danylenko <isbear@ukrpost.net>
parents:
3
diff
changeset
|
136 |
// print variable alone |
2c5225ab6eb7
Changed command syntax to allow unsetting
Myhailo Danylenko <isbear@ukrpost.net>
parents:
3
diff
changeset
|
137 |
char *value = getenv (arg); |
2c5225ab6eb7
Changed command syntax to allow unsetting
Myhailo Danylenko <isbear@ukrpost.net>
parents:
3
diff
changeset
|
138 |
|
2c5225ab6eb7
Changed command syntax to allow unsetting
Myhailo Danylenko <isbear@ukrpost.net>
parents:
3
diff
changeset
|
139 |
if (value) |
13
dbb001e9f800
Use new scr_* functions
Myhailo Danylenko <isbear@ukrpost.net>
parents:
12
diff
changeset
|
140 |
scr_log_print (LPRINT_NORMAL, "Env %s = %s", arg, value); |
4
2c5225ab6eb7
Changed command syntax to allow unsetting
Myhailo Danylenko <isbear@ukrpost.net>
parents:
3
diff
changeset
|
141 |
|
2c5225ab6eb7
Changed command syntax to allow unsetting
Myhailo Danylenko <isbear@ukrpost.net>
parents:
3
diff
changeset
|
142 |
} else if (varend == arg) |
2c5225ab6eb7
Changed command syntax to allow unsetting
Myhailo Danylenko <isbear@ukrpost.net>
parents:
3
diff
changeset
|
143 |
|
13
dbb001e9f800
Use new scr_* functions
Myhailo Danylenko <isbear@ukrpost.net>
parents:
12
diff
changeset
|
144 |
scr_log_print (LPRINT_NORMAL, "You must specify variable name."); |
4
2c5225ab6eb7
Changed command syntax to allow unsetting
Myhailo Danylenko <isbear@ukrpost.net>
parents:
3
diff
changeset
|
145 |
|
2c5225ab6eb7
Changed command syntax to allow unsetting
Myhailo Danylenko <isbear@ukrpost.net>
parents:
3
diff
changeset
|
146 |
else { |
0 | 147 |
|
4
2c5225ab6eb7
Changed command syntax to allow unsetting
Myhailo Danylenko <isbear@ukrpost.net>
parents:
3
diff
changeset
|
148 |
char *argstart = varend + 1; |
2c5225ab6eb7
Changed command syntax to allow unsetting
Myhailo Danylenko <isbear@ukrpost.net>
parents:
3
diff
changeset
|
149 |
char *var; |
2c5225ab6eb7
Changed command syntax to allow unsetting
Myhailo Danylenko <isbear@ukrpost.net>
parents:
3
diff
changeset
|
150 |
|
2c5225ab6eb7
Changed command syntax to allow unsetting
Myhailo Danylenko <isbear@ukrpost.net>
parents:
3
diff
changeset
|
151 |
for (varend--; varend > arg && *varend == ' '; --varend); |
2c5225ab6eb7
Changed command syntax to allow unsetting
Myhailo Danylenko <isbear@ukrpost.net>
parents:
3
diff
changeset
|
152 |
|
2c5225ab6eb7
Changed command syntax to allow unsetting
Myhailo Danylenko <isbear@ukrpost.net>
parents:
3
diff
changeset
|
153 |
var = g_strndup (arg, varend - arg + 1); |
2c5225ab6eb7
Changed command syntax to allow unsetting
Myhailo Danylenko <isbear@ukrpost.net>
parents:
3
diff
changeset
|
154 |
|
2c5225ab6eb7
Changed command syntax to allow unsetting
Myhailo Danylenko <isbear@ukrpost.net>
parents:
3
diff
changeset
|
155 |
while (!*argstart && *argstart == ' ') |
2c5225ab6eb7
Changed command syntax to allow unsetting
Myhailo Danylenko <isbear@ukrpost.net>
parents:
3
diff
changeset
|
156 |
++argstart; |
0 | 157 |
|
4
2c5225ab6eb7
Changed command syntax to allow unsetting
Myhailo Danylenko <isbear@ukrpost.net>
parents:
3
diff
changeset
|
158 |
if (*argstart) |
2c5225ab6eb7
Changed command syntax to allow unsetting
Myhailo Danylenko <isbear@ukrpost.net>
parents:
3
diff
changeset
|
159 |
// set variable |
2c5225ab6eb7
Changed command syntax to allow unsetting
Myhailo Danylenko <isbear@ukrpost.net>
parents:
3
diff
changeset
|
160 |
setenv (var, argstart, 1); |
2c5225ab6eb7
Changed command syntax to allow unsetting
Myhailo Danylenko <isbear@ukrpost.net>
parents:
3
diff
changeset
|
161 |
else |
2c5225ab6eb7
Changed command syntax to allow unsetting
Myhailo Danylenko <isbear@ukrpost.net>
parents:
3
diff
changeset
|
162 |
// unset variable |
2c5225ab6eb7
Changed command syntax to allow unsetting
Myhailo Danylenko <isbear@ukrpost.net>
parents:
3
diff
changeset
|
163 |
unsetenv (var); |
2c5225ab6eb7
Changed command syntax to allow unsetting
Myhailo Danylenko <isbear@ukrpost.net>
parents:
3
diff
changeset
|
164 |
|
2c5225ab6eb7
Changed command syntax to allow unsetting
Myhailo Danylenko <isbear@ukrpost.net>
parents:
3
diff
changeset
|
165 |
g_free (var); |
2c5225ab6eb7
Changed command syntax to allow unsetting
Myhailo Danylenko <isbear@ukrpost.net>
parents:
3
diff
changeset
|
166 |
} |
2c5225ab6eb7
Changed command syntax to allow unsetting
Myhailo Danylenko <isbear@ukrpost.net>
parents:
3
diff
changeset
|
167 |
} |
0 | 168 |
} |
169 |
||
3 | 170 |
// /cd [path] |
171 |
static void do_cd (char *arg) |
|
172 |
{ |
|
173 |
if (!*arg) { // get |
|
174 |
char cwd[256]; |
|
175 |
if (getcwd (cwd, 256) == NULL) |
|
13
dbb001e9f800
Use new scr_* functions
Myhailo Danylenko <isbear@ukrpost.net>
parents:
12
diff
changeset
|
176 |
scr_log_print (LPRINT_NORMAL, "Cannot obtain current working directory: %s.", strerror (errno)); |
3 | 177 |
else |
13
dbb001e9f800
Use new scr_* functions
Myhailo Danylenko <isbear@ukrpost.net>
parents:
12
diff
changeset
|
178 |
scr_log_print (LPRINT_NORMAL, "%s", cwd); |
3 | 179 |
} else if (chdir (arg) == -1) // set |
13
dbb001e9f800
Use new scr_* functions
Myhailo Danylenko <isbear@ukrpost.net>
parents:
12
diff
changeset
|
180 |
scr_log_print (LPRINT_NORMAL, "Cannot change current working directory: %s.", strerror (errno)); |
3 | 181 |
} |
182 |
||
11
dc7bcc0fa5e1
New module loading scheme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
5
diff
changeset
|
183 |
static void env_load (void) |
0 | 184 |
{ |
185 |
// command |
|
16
543bd8927354
Use new commands interface
Myhailo Danylenko <isbear@ukrpost.net>
parents:
15
diff
changeset
|
186 |
#ifndef HAVE_CMD_ID |
0 | 187 |
cmd_add ("env", "", 0, 0, do_env, NULL); |
3 | 188 |
cmd_add ("cd", "", COMPL_FILENAME, 0, do_cd, NULL); |
16
543bd8927354
Use new commands interface
Myhailo Danylenko <isbear@ukrpost.net>
parents:
15
diff
changeset
|
189 |
#else |
543bd8927354
Use new commands interface
Myhailo Danylenko <isbear@ukrpost.net>
parents:
15
diff
changeset
|
190 |
env_env_cmid = cmd_add ("env", "", 0, 0, do_env, NULL); |
543bd8927354
Use new commands interface
Myhailo Danylenko <isbear@ukrpost.net>
parents:
15
diff
changeset
|
191 |
env_cd_cmid = cmd_add ("cd", "", COMPL_FILENAME, 0, do_cd, NULL); |
543bd8927354
Use new commands interface
Myhailo Danylenko <isbear@ukrpost.net>
parents:
15
diff
changeset
|
192 |
#ifdef HAVE_CMD_SAFE |
543bd8927354
Use new commands interface
Myhailo Danylenko <isbear@ukrpost.net>
parents:
15
diff
changeset
|
193 |
env_env_set_safe = cmd_set_safe ("env", TRUE); |
543bd8927354
Use new commands interface
Myhailo Danylenko <isbear@ukrpost.net>
parents:
15
diff
changeset
|
194 |
env_cd_set_safe = cmd_set_safe ("cd", TRUE); |
543bd8927354
Use new commands interface
Myhailo Danylenko <isbear@ukrpost.net>
parents:
15
diff
changeset
|
195 |
#endif |
543bd8927354
Use new commands interface
Myhailo Danylenko <isbear@ukrpost.net>
parents:
15
diff
changeset
|
196 |
#endif |
0 | 197 |
} |
198 |
||
11
dc7bcc0fa5e1
New module loading scheme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
5
diff
changeset
|
199 |
static void env_unload (void) |
0 | 200 |
{ |
201 |
// command |
|
17
2c47fa36d473
Fix typo (reported by Hermitifier)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
16
diff
changeset
|
202 |
#ifndef HAVE_CMD_ID |
3 | 203 |
cmd_del ("cd"); |
0 | 204 |
cmd_del ("env"); |
16
543bd8927354
Use new commands interface
Myhailo Danylenko <isbear@ukrpost.net>
parents:
15
diff
changeset
|
205 |
#else |
543bd8927354
Use new commands interface
Myhailo Danylenko <isbear@ukrpost.net>
parents:
15
diff
changeset
|
206 |
if (env_env_cmid) |
543bd8927354
Use new commands interface
Myhailo Danylenko <isbear@ukrpost.net>
parents:
15
diff
changeset
|
207 |
cmd_del (env_env_cmid); |
543bd8927354
Use new commands interface
Myhailo Danylenko <isbear@ukrpost.net>
parents:
15
diff
changeset
|
208 |
if (env_cd_cmid) |
543bd8927354
Use new commands interface
Myhailo Danylenko <isbear@ukrpost.net>
parents:
15
diff
changeset
|
209 |
cmd_del (env_cd_cmid); |
543bd8927354
Use new commands interface
Myhailo Danylenko <isbear@ukrpost.net>
parents:
15
diff
changeset
|
210 |
#ifdef HAVE_CMD_SAFE |
543bd8927354
Use new commands interface
Myhailo Danylenko <isbear@ukrpost.net>
parents:
15
diff
changeset
|
211 |
if (env_env_set_safe) |
543bd8927354
Use new commands interface
Myhailo Danylenko <isbear@ukrpost.net>
parents:
15
diff
changeset
|
212 |
cmd_set_safe ("env", FALSE); |
543bd8927354
Use new commands interface
Myhailo Danylenko <isbear@ukrpost.net>
parents:
15
diff
changeset
|
213 |
if (env_cd_set_safe) |
543bd8927354
Use new commands interface
Myhailo Danylenko <isbear@ukrpost.net>
parents:
15
diff
changeset
|
214 |
cmd_set_safe ("cd", FALSE); |
543bd8927354
Use new commands interface
Myhailo Danylenko <isbear@ukrpost.net>
parents:
15
diff
changeset
|
215 |
#endif |
543bd8927354
Use new commands interface
Myhailo Danylenko <isbear@ukrpost.net>
parents:
15
diff
changeset
|
216 |
#endif |
0 | 217 |
} |
218 |
||
3 | 219 |
/* vim: se ts=4 sw=4: */ |