Changeset 138f0c in git for Singular/febase.cc
- Timestamp:
- Nov 15, 1999, 1:53:28 PM (25 years ago)
- Branches:
- (u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
- Children:
- d9909c94593c093ae99a6b1884d5343aba29fbb3
- Parents:
- 8f0190b06443e3b86ce8a435044847907447e7a9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/febase.cc
r8f0190 r138f0c 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: febase.cc,v 1.8 3 1999-09-21 14:44:58 obachman Exp $ */4 /* $Id: febase.cc,v 1.84 1999-11-15 12:53:28 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: i/o system … … 18 18 #ifdef NeXT 19 19 #include <sys/file.h> 20 #endif 21 22 #ifdef HAVE_PWD_H 23 #include "pwd.h" 20 24 #endif 21 25 … … 102 106 if (path[0]=='~') 103 107 { 104 char* home = getenv("HOME"); 105 if (home != NULL) 106 { 107 strcpy(longpath, home); 108 strcat(longpath, &(path[1])); 109 path = longpath; 110 } 108 if (path[1] == DIR_SEP) 109 { 110 char* home = getenv("HOME"); 111 if (home != NULL) 112 { 113 strcpy(longpath, home); 114 strcat(longpath, &(path[1])); 115 path = longpath; 116 } 117 } 118 #if defined(HAVE_PWD_H) && defined(HAVE_GETPWNAM) 119 else 120 { 121 char* dir_sep; 122 struct passwd *pw_entry; 123 strcpy (longpath, path); 124 dir_sep = strchr(longpath, DIR_SEP); 125 *dir_sep = '\0'; 126 pw_entry = getpwnam(&longpath[1]); 127 if (pw_entry != NULL) 128 { 129 strcpy(longpath, pw_entry->pw_dir); 130 dir_sep = strchr(path, DIR_SEP); 131 strcat(longpath, dir_sep); 132 path = longpath; 133 } 134 } 135 #endif 111 136 } 112 137 FILE * f=NULL;
Note: See TracChangeset
for help on using the changeset viewer.