diff options
Diffstat (limited to 'src/mt/config.cc')
| -rw-r--r-- | src/mt/config.cc | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/mt/config.cc b/src/mt/config.cc new file mode 100644 index 0000000..1797780 --- /dev/null +++ b/src/mt/config.cc | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | /************************************************************************* | ||
| 2 | * | ||
| 3 | * HTCd - Copyright (C) 1998-2006 Henrik Rydberg | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License as published by | ||
| 7 | * the Free Software Foundation; either version 2 of the License, or | ||
| 8 | * (at your option) any later version. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | * | ||
| 15 | * You should have received a copy of the GNU General Public License | ||
| 16 | * along with this program; if not, write to the Free Software | ||
| 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 18 | */ | ||
| 19 | |||
| 20 | #include <mt/config.h> | ||
| 21 | |||
| 22 | mstring htchome() | ||
| 23 | { | ||
| 24 | const char* p=getenv("HTCHOME"); | ||
| 25 | if(!p) { | ||
| 26 | fprintf(stderr,"env: HTCHOME not set, exiting\n"); | ||
| 27 | exit(-1); | ||
| 28 | } | ||
| 29 | mstring home=p; | ||
| 30 | if(home.back()=='/') home=home.popb(); | ||
| 31 | return home; | ||
| 32 | } | ||
| 33 | |||
