31 |
|
|
32 |
if (!env->set) |
if (!env->set) |
33 |
{ |
{ |
34 |
util_error("No value set for \"folder\""); |
util_error ("No value set for \"folder\""); |
35 |
return 1; |
return 1; |
36 |
} |
} |
37 |
|
|
38 |
path = util_fullpath(env->value); |
path = env->value; |
39 |
util_do_command("! %s %s", getenv("LISTER"), path); |
if (path[0] != '/' && path[0] != '~') |
40 |
|
{ |
41 |
|
char *tmp = alloca (strlen (path) + 3); |
42 |
|
if (!tmp) |
43 |
|
{ |
44 |
|
util_error ("Not enough memory"); |
45 |
|
return 1; |
46 |
|
} |
47 |
|
|
48 |
|
tmp[0] = '~'; |
49 |
|
tmp[1] = '/'; |
50 |
|
strcpy (tmp + 2, path); |
51 |
|
path = tmp; |
52 |
|
} |
53 |
|
|
54 |
|
path = util_fullpath (path); |
55 |
|
|
56 |
|
util_do_command("! %s %s", getenv ("LISTER"), path); |
57 |
free(path); |
free(path); |
58 |
|
|
59 |
return 0; |
return 0; |