mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-31 21:20:33 +00:00
Double quote dag labels.
Dot interprets escape sequences in non-html string, and needs the quotes to be escaped, so quote the result of operand_string. Unfortunately, operand_string uses quote_string and quote_string returns a static pointer, so some hoop-jumping is necessary.
This commit is contained in:
parent
cdc790d0c8
commit
5acf474882
1 changed files with 10 additions and 1 deletions
|
@ -39,10 +39,13 @@
|
|||
#endif
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "QF/dstring.h"
|
||||
|
||||
#include "dags.h"
|
||||
#include "diagnostic.h"
|
||||
#include "qfcc.h"
|
||||
#include "statements.h"
|
||||
#include "strpool.h"
|
||||
#include "symtab.h"
|
||||
|
||||
static daglabel_t *free_labels;
|
||||
|
@ -93,11 +96,17 @@ new_node (void)
|
|||
const char *
|
||||
daglabel_string (daglabel_t *label)
|
||||
{
|
||||
static dstring_t *str;
|
||||
if ((label->opcode && label->op) || (!label->opcode && !label->op))
|
||||
return "bad label";
|
||||
if (label->opcode)
|
||||
return label->opcode;
|
||||
return operand_string (label->op);
|
||||
if (!str)
|
||||
str = dstring_new ();
|
||||
// operand_string might use quote_string, which returns a pointer to
|
||||
// a static variable.
|
||||
dstring_copystr (str, operand_string (label->op));
|
||||
return quote_string (str->str);
|
||||
}
|
||||
|
||||
static daglabel_t *
|
||||
|
|
Loading…
Reference in a new issue