MCPcopy Create free account
hub / github.com/NetHack/NetHack / adjust_prefix

Function adjust_prefix

src/cfgfiles.c:440–459  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

438
439#ifdef NOCWD_ASSUMPTIONS
440staticfn void
441adjust_prefix(char *bufp, int prefixid)
442{
443 char *ptr;
444
445 if (!bufp)
446 return;
447#ifdef WIN32
448 if (fqn_prefix_locked[prefixid])
449 return;
450#endif
451 /* Backward compatibility, ignore trailing ;n */
452 if ((ptr = strchr(bufp, ';')) != 0)
453 *ptr = '\0';
454 if (strlen(bufp) > 0) {
455 gf.fqn_prefix[prefixid] = (char *) alloc(strlen(bufp) + 2);
456 Strcpy(gf.fqn_prefix[prefixid], bufp);
457 append_slash(gf.fqn_prefix[prefixid]);
458 }
459}
460#endif
461
462/* Choose at random one of the sep separated parts from str. Mangles str. */

Callers 9

cnf_line_HACKDIRFunction · 0.85
cnf_line_LEVELDIRFunction · 0.85
cnf_line_SAVEDIRFunction · 0.85
cnf_line_BONESDIRFunction · 0.85
cnf_line_DATADIRFunction · 0.85
cnf_line_SCOREDIRFunction · 0.85
cnf_line_LOCKDIRFunction · 0.85
cnf_line_CONFIGDIRFunction · 0.85
cnf_line_TROUBLEDIRFunction · 0.85

Calls 2

allocFunction · 0.70
append_slashFunction · 0.50

Tested by

no test coverage detected