projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added model summary and R keyword
[pspp]
/
src
/
title.c
diff --git
a/src/title.c
b/src/title.c
index 50a065b9d846bbd1c5483f138a572da9b7e638ed..d4a95c18d478e3eb35fd6d602df1b9301aca8f9f 100644
(file)
--- a/
src/title.c
+++ b/
src/title.c
@@
-14,14
+14,15
@@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 5
9 Temple Place - Suite 330
, Boston, MA
- 0211
1-1307
, USA. */
+ Foundation, Inc., 5
1 Franklin Street, Fifth Floor
, Boston, MA
+ 0211
0-1301
, USA. */
#include <config.h>
#include <ctype.h>
#include <stdlib.h>
#include "alloc.h"
#include "command.h"
#include <config.h>
#include <ctype.h>
#include <stdlib.h>
#include "alloc.h"
#include "command.h"
+#include "dictionary.h"
#include "error.h"
#include "lexer.h"
#include "main.h"
#include "error.h"
#include "lexer.h"
#include "main.h"
@@
-30,6
+31,9
@@
#include "version.h"
#include "vfm.h"
#include "version.h"
#include "vfm.h"
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
+
#include "debug-print.h"
static int get_title (const char *cmd, char **title);
#include "debug-print.h"
static int get_title (const char *cmd, char **title);
@@
-60,7
+64,7
@@
get_title (const char *cmd, char **title)
return CMD_FAILURE;
if (*title)
free (*title);
return CMD_FAILURE;
if (*title)
free (*title);
- *title = xstrdup (ds_
value
(&tokstr));
+ *title = xstrdup (ds_
c_str
(&tokstr));
lex_get ();
if (token != '.')
{
lex_get ();
if (token != '.')
{
@@
-75,6
+79,7
@@
get_title (const char *cmd, char **title)
if (*title)
free (*title);
*title = xstrdup (lex_rest_of_line (NULL));
if (*title)
free (*title);
*title = xstrdup (lex_rest_of_line (NULL));
+ lex_discard_line ();
for (cp = *title; *cp; cp++)
*cp = toupper ((unsigned char) (*cp));
token = '.';
for (cp = *title; *cp; cp++)
*cp = toupper ((unsigned char) (*cp));
token = '.';
@@
-87,9
+92,10
@@
get_title (const char *cmd, char **title)
int
cmd_file_label (void)
{
int
cmd_file_label (void)
{
- char *label;
+ c
onst c
har *label;
label = lex_rest_of_line (NULL);
label = lex_rest_of_line (NULL);
+ lex_discard_line ();
while (isspace ((unsigned char) *label))
label++;
while (isspace ((unsigned char) *label))
label++;
@@
-114,7
+120,7
@@
add_document_line (const char *line, int indent)
memcpy (new_documents, old_documents, old_len);
memset (new_documents + old_len, ' ', indent);
memcpy (new_documents, old_documents, old_len);
memset (new_documents + old_len, ' ', indent);
-
st_bare_pad_copy (new_documents + old_len + indent, line, 80 - indent
);
+
buf_copy_str_rpad (new_documents + old_len + indent, 80 - indent, line
);
new_documents[old_len + 80] = '\0';
dict_set_documents (default_dict, new_documents);
new_documents[old_len + 80] = '\0';
dict_set_documents (default_dict, new_documents);
@@
-143,20
+149,21
@@
cmd_document (void)
for (;;)
{
int had_dot;
for (;;)
{
int had_dot;
- char *line;
+ const char *orig_line;
+ char *copy_line;
- line = lex_rest_of_line (&had_dot);
- while (isspace ((unsigned char) *line))
- line++;
+ orig_line = lex_rest_of_line (&had_dot);
+ lex_discard_line ();
+ while (isspace ((unsigned char) *orig_line))
+ orig_line++;
+ copy_line = xmalloc (strlen (orig_line) + 2);
+ strcpy (copy_line, orig_line);
if (had_dot)
if (had_dot)
- {
- char *cp = strchr (line, 0);
- *cp++ = '.';
- *cp = 0;
- }
+ strcat (copy_line, ".");
- add_document_line (line, 3);
+ add_document_line (copy_line, 3);
+ free (copy_line);
lex_get_line ();
if (had_dot)
lex_get_line ();
if (had_dot)