Skip to content

Building for Linux #3

@mingodad

Description

@mingodad

Also happen with clips-6.4.2 from sourceforge.

I've noticed that when building on Linux a preprocessor macro is defined -DLINUX but building on Ubuntu-18-04 with gcc-9.4 the resulting binary doesn't accept ^C to quit, but if I remove the -DLINUX then the resulting binary does accept ^C.

Also would be nice to have a command line help option, I've implemented a simple one as this:

------------------------------- core/commline.c -------------------------------
old mode 100755
new mode 100644
index 0804f8e..2e7e45b
@@ -191,7 +191,7 @@ void RerouteStdin(
    /* the -f argument, then return.        */
    /*======================================*/
 
-   if (argc < 3)
+   if (argc < 2)
      { return; }
 
    /*=====================================*/
@@ -206,7 +206,11 @@ void RerouteStdin(
 
    for (i = 1 ; i < argc ; i++)
      {
-      if (strcmp(argv[i],"-f") == 0) theSwitch = BATCH_SWITCH;
+      if (argc < 3 || strcmp(argv[i],"-h") == 0) {
+          printf("usage: %s [-h] | [(-f | -f2 | -l) file_name]\n", argv[0]);
+          exit(1);
+      }
+      else if (strcmp(argv[i],"-f") == 0) theSwitch = BATCH_SWITCH;
 #if ! RUN_TIME
       else if (strcmp(argv[i],"-f2") == 0) theSwitch = BATCH_STAR_SWITCH;
       else if (strcmp(argv[i],"-l") == 0) theSwitch = LOAD_SWITCH;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions