strcpy(matchstr, filename); strcat(matchstr, "/"); match = 1; break; 
strncpy(matchstr, filename, PATH_MAX - 1); strncat(matchstr, "/", PATH_MAX - strlen(matchstr) - 1); match = 1; break; 
static void completeDir(Widget w,XEvent *e, XtPointer data){  char *p;  DirPath full;  p = XawDialogGetValueString(load_d);  if (!expandDir(p, &full))    ctl->cmsg(CMSG_WARNING,VERB_NORMAL,"something wrong with getting path.");  if(full.basename != NULL) {    int len, match = 0;    char filename[PATH_MAX], matchstr[PATH_MAX],*path = "/";    char *fullpath;    URL dirp;    len = strlen(full.basename);    if(strlen(full.dirname)) path = full.dirname;    if (NULL != (dirp=url_dir_open(path))) {      MBlockList pool;      init_mblock(&pool);      while (url_gets(dirp, filename, sizeof(filename)) != NULL) {        if (!strncmp(full.basename, filename, len)) {          struct stat st;          fullpath = (char *)new_segment(&pool,                            strlen(full.dirname) + strlen(filename) + 2);          sprintf(fullpath, "%s/%s", full.dirname, filename);          if (stat(fullpath, &st) == -1)            continue;          if (!match)            strcpy(matchstr, filename);          else            strmatch(matchstr, filename);          match++;          if(S_ISDIR(st.st_mode) && (!strcmp(filename,full.basename))) {            strcpy(matchstr, filename);            strcat(matchstr, "/"); match = 1; break;          }        }      }      if (match) {        sprintf(filename, "%s/%s", full.dirname, matchstr);        XtVaSetValues(load_d,XtNvalue,filename,NULL);      }      url_close(dirp);      reuse_mblock(&pool);    }  }}
4357	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4357/361cc5df1e14516b0a3eef7766539860da9a9721/xaw_i.c/clean/interface/xaw_i.c