Free Hero Mesh

Check-in [28772e0e31]
Login
This is a mirror of the main repository for Free Hero Mesh. New tickets and changes will not be accepted at this mirror.
Overview
Comment:Change har.c so that wildcards can be used.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 28772e0e31d321ae18e17eed5af1ee3bee10f41b
User & Date: user on 2023-01-07 06:07:38
Other Links: manifest | tags
Context
2023-01-10
04:10
Mention the GitHub mirror in the README file. check-in: 24de865454 user: user tags: trunk
2023-01-07
06:07
Change har.c so that wildcards can be used. check-in: 28772e0e31 user: user tags: trunk
2023-01-02
20:42
Update PORTING file (use of JavaScript codes in compiling). check-in: 13f860d88e user: user tags: trunk
Changes

Modified misc/har.c from [bd2c90d441] to [398da2db3e].

10
11
12
13
14
15
16

17
18

19
20
21
22
23
24
25
10
11
12
13
14
15
16
17
18

19
20
21
22
23
24
25
26







+

-
+







  c = Create
  d = Delete
  l = Lowercase
  o = Extract to stdout
  r = Rename
  s = Safe
  t = List
  w = Wildcards
  u = Uppercase
  x = Extract
  x = Extract to files
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define fatal(...) do { fprintf(stderr,__VA_ARGS__); putchar('\n'); exit(1); } while(0)
91
92
93
94
95
96
97












98
99
100
101
102
103
104
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117







+
+
+
+
+
+
+
+
+
+
+
+







    } else {
      o=0;
      for(n=2;n<argc;n++) {
        if(!strcmp(name,argv[n])) {
          o=1;
          if(opt['r'] && ++n<argc) strcpy(name,argv[n]);
          break;
        } else if(opt['w']) {
          for(c=d=0;;c++,d++) {
            if(argv[n][c]=='*') {
              d+=strlen(name)-strlen(argv[n]);
              if(d>=strlen(name) || d<c) break;
            } else if(argv[n][c]!=name[d] && argv[n][c]!='?') {
              break;
            } else if(!name[d]) {
              o=1;
              break;
            }
          }
        }
        if(opt['r']) n++;
      }
    }
    if(opt['d']) o=!o;
  }
  if(o && opt['t']) {