projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Split pspp.texi into one texi file per chapter
[pspp]
/
src
/
command.c
diff --git
a/src/command.c
b/src/command.c
index 071c7e4e9ecb89942d1a3394c229a4019357126f..5ff4f0de2c0e746cfac3c81b28cb05e9f6380cb6 100644
(file)
--- a/
src/command.c
+++ b/
src/command.c
@@
-293,6
+293,12
@@
conflicting_3char_prefixes (const char *a, const char *b)
bw = find_word (b, &bw_len);
assert (aw != NULL && bw != NULL);
bw = find_word (b, &bw_len);
assert (aw != NULL && bw != NULL);
+ /* Words that are the same don't conflict. */
+ if (aw_len == bw_len && !memcmp (aw, bw, aw_len))
+ return 0;
+
+ /* Words that are otherwise the same in the first three letters
+ do conflict. */
return ((aw_len > 3 && bw_len > 3)
|| (aw_len == 3 && bw_len > 3)
|| (bw_len == 3 && aw_len > 3)) && !memcmp (aw, bw, 3);
return ((aw_len > 3 && bw_len > 3)
|| (aw_len == 3 && bw_len > 3)
|| (bw_len == 3 && aw_len > 3)) && !memcmp (aw, bw, 3);
@@
-480,7
+486,7
@@
parse_command_name (void)
assert (word_cnt < sizeof words / sizeof *words);
if (token == T_ID)
assert (word_cnt < sizeof words / sizeof *words);
if (token == T_ID)
- words[word_cnt++] = xstrdup (ds_
value
(&tokstr));
+ words[word_cnt++] = xstrdup (ds_
c_str
(&tokstr));
else
words[word_cnt++] = xstrdup ("-");
else
words[word_cnt++] = xstrdup ("-");
@@
-626,10
+632,10
@@
cmd_erase (void)
if (!lex_force_string ())
return CMD_FAILURE;
if (!lex_force_string ())
return CMD_FAILURE;
- if (remove (ds_
value
(&tokstr)) == -1)
+ if (remove (ds_
c_str
(&tokstr)) == -1)
{
msg (SW, _("Error removing `%s': %s."),
{
msg (SW, _("Error removing `%s': %s."),
- ds_
value
(&tokstr), strerror (errno));
+ ds_
c_str
(&tokstr), strerror (errno));
return CMD_FAILURE;
}
return CMD_FAILURE;
}
@@
-707,7
+713,7
@@
run_command (void)
lex_get ();
if (!lex_force_string ())
return CMD_FAILURE;
lex_get ();
if (!lex_force_string ())
return CMD_FAILURE;
- cmd = ds_
value
(&tokstr);
+ cmd = ds_
c_str
(&tokstr);
string = 1;
}
else
string = 1;
}
else
@@
-765,11
+771,11
@@
cmd_host (void)
/* Make sure that the system has a command interpreter, then run a
command. */
if (system (NULL) != 0)
/* Make sure that the system has a command interpreter, then run a
command. */
if (system (NULL) != 0)
-
success
= run_command ();
+
code
= run_command ();
else
{
msg (SE, _("No operating system support for this command."));
else
{
msg (SE, _("No operating system support for this command."));
-
success
= CMD_FAILURE;
+
code
= CMD_FAILURE;
}
#endif /* !unix */
}
#endif /* !unix */