Changeset 82a884b in git for Singular/febase.cc
- Timestamp:
- Jan 27, 1998, 3:10:15 PM (26 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 1f3f0e80b4082b3102b965bbc5583208d5ba465a
- Parents:
- 10b3a752e88f890c4be07205f527a9623b8284b7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/febase.cc
r10b3a7 r82a884b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: febase.cc,v 1.2 3 1997-11-18 16:30:52 SingularExp $ */4 /* $Id: febase.cc,v 1.24 1998-01-27 14:10:15 pohl Exp $ */ 5 5 /* 6 6 * ABSTRACT: i/o system … … 107 107 { 108 108 FILE * f=fopen(path,mode); 109 #ifdef macintosh 110 if (f!=NULL) 111 { 112 if (where!=NULL) strcpy(where,path); 113 return f; 114 } 115 char *res; 116 int idat=strlen(SINGULAR_DATADIR),ipath=strlen(path); 117 char *env=getenv("SINGULARPATH"); 118 int ienv=strlen(env), ii=ienv; 119 if (ii<idat) ii = idat; 120 if (ii==0) 121 { 122 if (useWerror) 123 Werror("cannot open `%s`",path); 124 return f; 125 } 126 res=(char*) AllocL(ii+ipath+1); 127 if (ienv!=0) 128 { 129 memcpy(res,env,ienv); 130 memcpy(res+ienv,path,ipath); 131 res[ienv+ipath]='\0'; 132 f=fopen(res,mode); 133 } 134 if ((f==NULL)&&(idat!=0)) 135 { 136 memcpy(res,SINGULAR_DATADIR,idat); 137 memcpy(res+idat,path,ipath); 138 res[idat+ipath]='\0'; 139 f=fopen(res,mode); 140 } 141 if (f==NULL) 142 { 143 if (useWerror) 144 Werror("cannot open `%s`",res); 145 } 146 else if (where!=NULL) 147 strcpy(where,res); 148 FreeL(res); 149 #else 109 150 if (where!=NULL) strcpy(where,path); 110 151 if ((*mode=='r') && (path[0]!=DIR_SEP)&&(path[0]!='.') … … 178 219 if ((f==NULL)&&(useWerror)) 179 220 Werror("cannot open `%s`",path); 221 #endif 180 222 return f; 181 223 }
Note: See TracChangeset
for help on using the changeset viewer.