mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-06-01 09:02:08 +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
|
#endif
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "QF/dstring.h"
|
||||||
|
|
||||||
#include "dags.h"
|
#include "dags.h"
|
||||||
#include "diagnostic.h"
|
#include "diagnostic.h"
|
||||||
#include "qfcc.h"
|
#include "qfcc.h"
|
||||||
#include "statements.h"
|
#include "statements.h"
|
||||||
|
#include "strpool.h"
|
||||||
#include "symtab.h"
|
#include "symtab.h"
|
||||||
|
|
||||||
static daglabel_t *free_labels;
|
static daglabel_t *free_labels;
|
||||||
|
@ -93,11 +96,17 @@ new_node (void)
|
||||||
const char *
|
const char *
|
||||||
daglabel_string (daglabel_t *label)
|
daglabel_string (daglabel_t *label)
|
||||||
{
|
{
|
||||||
|
static dstring_t *str;
|
||||||
if ((label->opcode && label->op) || (!label->opcode && !label->op))
|
if ((label->opcode && label->op) || (!label->opcode && !label->op))
|
||||||
return "bad label";
|
return "bad label";
|
||||||
if (label->opcode)
|
if (label->opcode)
|
||||||
return 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 *
|
static daglabel_t *
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue