… | |
… | |
345 | */ |
345 | */ |
346 | if (!strcmp (key, "region")) |
346 | if (!strcmp (key, "region")) |
347 | { |
347 | { |
348 | *end = 0; |
348 | *end = 0; |
349 | newreg = get_region_struct (); |
349 | newreg = get_region_struct (); |
350 | newreg->name = strdup_local (value); |
350 | newreg->name = strdup (value); |
351 | } |
351 | } |
352 | else if (!strcmp (key, "parent")) |
352 | else if (!strcmp (key, "parent")) |
353 | { |
353 | { |
354 | /* |
354 | /* |
355 | * Note that this is in the initialisation code, so we don't actually |
355 | * Note that this is in the initialisation code, so we don't actually |
356 | * assign the pointer to the parent yet, because it might not have been |
356 | * assign the pointer to the parent yet, because it might not have been |
357 | * parsed. |
357 | * parsed. |
358 | */ |
358 | */ |
359 | *end = 0; |
359 | *end = 0; |
360 | newreg->parent_name = strdup_local (value); |
360 | newreg->parent_name = strdup (value); |
361 | } |
361 | } |
362 | else if (!strcmp (key, "longname")) |
362 | else if (!strcmp (key, "longname")) |
363 | { |
363 | { |
364 | *end = 0; |
364 | *end = 0; |
365 | newreg->longname = strdup_local (value); |
365 | newreg->longname = strdup (value); |
366 | } |
366 | } |
367 | else if (!strcmp (key, "jail")) |
367 | else if (!strcmp (key, "jail")) |
368 | { |
368 | { |
369 | /* jail entries are of the form: /path/to/map x y */ |
369 | /* jail entries are of the form: /path/to/map x y */ |
370 | char path[MAX_BUF]; |
370 | char path[MAX_BUF]; |
… | |
… | |
373 | if (sscanf (value, "%[^ ] %d %d\n", path, &x, &y) != 3) |
373 | if (sscanf (value, "%[^ ] %d %d\n", path, &x, &y) != 3) |
374 | { |
374 | { |
375 | LOG (llevError, "region.c: malformated regions entry: jail %s\n", value); |
375 | LOG (llevError, "region.c: malformated regions entry: jail %s\n", value); |
376 | continue; |
376 | continue; |
377 | } |
377 | } |
378 | newreg->jailmap = strdup_local (path); |
378 | newreg->jailmap = strdup (path); |
379 | newreg->jailx = x; |
379 | newreg->jailx = x; |
380 | newreg->jaily = y; |
380 | newreg->jaily = y; |
381 | } |
381 | } |
382 | else if (!strcmp (key, "msg")) |
382 | else if (!strcmp (key, "msg")) |
383 | { |
383 | { |
… | |
… | |
395 | * There may be regions with empty messages (eg, msg/endmsg |
395 | * There may be regions with empty messages (eg, msg/endmsg |
396 | * with nothing between). When maps are loaded, this is done |
396 | * with nothing between). When maps are loaded, this is done |
397 | * so better do it here too... |
397 | * so better do it here too... |
398 | */ |
398 | */ |
399 | if (msgpos != 0) |
399 | if (msgpos != 0) |
400 | newreg->msg = strdup_local (msgbuf); |
400 | newreg->msg = strdup (msgbuf); |
401 | |
401 | |
402 | /* we have to reset msgpos, or the next region will store both msg blocks. */ |
402 | /* we have to reset msgpos, or the next region will store both msg blocks. */ |
403 | msgpos = 0; |
403 | msgpos = 0; |
404 | } |
404 | } |
405 | else if (!strcmp (key, "fallback")) |
405 | else if (!strcmp (key, "fallback")) |