static int is_processing = 0;
static int signal_count = 0;
+static char *executable;
+static int is_tdl = 0;
+
static void handle_signal(int a)/*{{{*/
{
signal_count++;
void dispatch(char **argv) /* and other args *//*{{{*/
{
int i, p_len, matchlen, index=-1;
- char *executable;
- int is_tdl;
char **p, **pp;
if (signal_count > 0) {
unlock_and_exit(0);
}
- executable = executable_name(argv[0]);
- is_tdl = (!strcmp(executable, "tdl"));
-
p = argv + 1;
- while (*p && *p[0] == '-') p++;
+ if (is_tdl)
+ while (*p && *p[0] == '-') p++;
/* Parse command line */
if (is_tdl && !*p) {
int main (int argc, char **argv)
{
int i = 0;
+
+ executable = executable_name(argv[0]);
+ is_tdl = (!strcmp(executable, "tdl"));
+
n_cmds = N(cmds);
is_interactive = 0;
top.prev = (struct node *) ⊤
top.next = (struct node *) ⊤
- if (argc > 1) {
+ if (argc > 1 && is_tdl) {
for (i=1; i<argc && argv[i][0] == '-'; i++) {
if (strspn(argv[i]+1, "qRu")+1 != strlen(argv[i])) {
fprintf(stderr, "Unknown flag <%s>\n", argv[i]);