Fixed a relative path usage
This commit is contained in:
parent
8b49add1be
commit
d0ca6c8af9
@ -10,13 +10,17 @@ ______________________________________________________________________
|
||||
Notes for GoldED+ 1.1.5, /snapshot/
|
||||
______________________________________________________________________
|
||||
|
||||
- Relative path usage is fixed. Now a Real UID is used to parse "~/" always.
|
||||
|
||||
+ Several unicode charset convertion tables is included into distribution of
|
||||
the config examples.
|
||||
|
||||
+ Relative path may be used for patchnames definiions in config. User's home
|
||||
directory (~/) may be used in unixes. Example:
|
||||
+ Gedlnx: Relative path may be used for patchnames definiions in config.
|
||||
User's home directory (~/) may be used in unixes. Examples:
|
||||
|
||||
include ~/golded.cfg ; include the user-specific subconfig
|
||||
include ~/golded.cfg ; include the user-specific subconfig of current user
|
||||
include ~fido/configs/golded.cfg ; include specific subconfig of user fido
|
||||
seqdir ~fido ; specify MSGID-sequence store path to /home/fido/
|
||||
|
||||
! Temporarily disabled the AreaRecycleBin.
|
||||
|
||||
|
@ -317,11 +317,9 @@ void TouchFile(const char* filename) {
|
||||
|
||||
char* PathCopy(char* __dst, const char* __src) {
|
||||
strschg_environ(strxcpy(__dst, __src, sizeof(Path)));
|
||||
getcwd(__dst, sizeof(Path)); // expand ~/ & etc.
|
||||
return AddBackslash(__dst);
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
int TestLockPath(const char* __path) {
|
||||
|
@ -89,16 +89,16 @@ int strschg_environ(std::string& s) {
|
||||
std::string name;
|
||||
char* lname;
|
||||
const char *p = s.c_str()+1;
|
||||
struct passwd *pe=NULL;
|
||||
|
||||
if((s.length() != 1) and not isslash(*p)) {
|
||||
while(*p and not isslash(*p))
|
||||
name += *p++;
|
||||
pe = getpwnam(name.c_str());
|
||||
}
|
||||
else {
|
||||
if ((lname = getlogin()) == NULL)
|
||||
lname = getenv("LOGNAME");
|
||||
name = lname;
|
||||
pe = getpwuid(getuid());
|
||||
}
|
||||
struct passwd *pe = getpwnam(name.c_str());
|
||||
if(pe != NULL) {
|
||||
std::string dirname = pe->pw_dir;
|
||||
dirname += "/";
|
||||
|
Reference in New Issue
Block a user