Changeset bb9659 in git for Singular/fehelp.cc
- Timestamp:
- Jul 21, 2014, 11:16:26 AM (9 years ago)
- Branches:
- (u'spielwiese', '873fc1222e995d7cb33f79d8f1792ce418c8c72c')
- Children:
- 638c230a7830a70d265a617a0f2f2fa0505f2ec0
- Parents:
- 31d40c145242ddd7da4100d5cad7ccb19297b6ad
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/fehelp.cc
r31d40c rbb9659 501 501 } 502 502 if (c == EOF) goto Failure; 503 if (hentry->node[0]=='\0') 504 strcpy(hentry->node,hentry->key); 503 505 504 506 // get url 505 hentry->node[i] = '\0';507 //hentry->node[i] = '\0'; 506 508 i = 0; 507 509 while ((c = getc(fd)) != '\t' && c != EOF) … … 1145 1147 Warn("information on Singular running under Emacs, type C-h m."); 1146 1148 } 1147 static int singular_manual(char *str );1149 static int singular_manual(char *str, BOOLEAN isIndexEntry); 1148 1150 static void heBuiltinHelp(heEntry hentry, int /*br*/) 1149 1151 { 1150 char* node = omStrDup(hentry != NULL && *(hentry-> node) != '\0' ?1151 hentry-> node: "Top");1152 singular_manual(node );1152 char* node = omStrDup(hentry != NULL && *(hentry->key) != '\0' ? 1153 hentry->key : "Top"); 1154 singular_manual(node,(hentry != NULL) && (hentry->url!=NULL)); 1153 1155 omFree(node); 1154 1156 } … … 1214 1216 1215 1217 /*************************************************/ 1216 static int singular_manual(char *str )1218 static int singular_manual(char *str, BOOLEAN isIndexEntry) 1217 1219 { FILE *index=NULL; 1218 1220 unsigned long offset; … … 1229 1231 } 1230 1232 1231 for(p=str; *p; p++) *p = tolow(*p);/* */ 1232 do 1233 { 1234 p--; 1235 } 1236 while ((p != str) && (*p<=' ')); 1237 p++; 1238 *p='\0'; 1239 (void)sprintf(String, " %s ", str); 1233 if (!isIndexEntry) 1234 { 1235 for(p=str; *p; p++) *p = tolow(*p);/* */ 1236 do 1237 { 1238 p--; 1239 } 1240 while ((p != str) && (*p<=' ')); 1241 p++; 1242 *p='\0'; 1243 (void)sprintf(String, " %s ", str); 1244 } 1245 else 1246 { 1247 (void)sprintf(String, " %s", str); 1248 } 1240 1249 1241 1250 while(!feof(index) … … 1245 1254 while(!feof(index)) 1246 1255 { 1247 // char* dummy=fgets(buffer, BUF_LEN, index); /* */ 1248 (void)si_sscanf(buffer, "Node:%[^\177]\177%ld\n", Index, &offset); 1249 for(p=Index; *p; p++) *p = tolow(*p);/* */ 1250 (void)strcat(Index, " "); 1251 if( strstr(Index, String)!=NULL) 1256 if (fgets(buffer, BUF_LEN, index)==NULL) break; /*fill buffer */ 1257 if (si_sscanf(buffer, "Node:%[^\177]\177%ld\n", Index, &offset)!=2) 1258 continue; 1259 if (!isIndexEntry) 1260 { 1261 for(p=Index; *p; p++) *p = tolow(*p);/* */ 1262 (void)strcat(Index, " "); 1263 if( strstr(Index, String)!=NULL) 1264 { 1265 done++; (void)show(offset, &close); 1266 } 1267 } 1268 else if( strcmp(Index, String)==0) 1252 1269 { 1253 1270 done++; (void)show(offset, &close); 1271 break; 1254 1272 } 1255 1273 Index[0]='\0'; … … 1258 1276 } 1259 1277 if (index != NULL) (void)fclose(index); 1260 if( ! done)1278 if(done==0) 1261 1279 { 1262 1280 Warn("`%s` not found",String);
Note: See TracChangeset
for help on using the changeset viewer.