/*
- * $Id: volume.c,v 1.43 2002-11-15 10:59:11 srittau Exp $
+ * $Id: volume.c,v 1.46 2003-01-12 14:40:04 didg Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
options[VOLOPT_FLAGS].i_value |= AFPVOL_DROPBOX;
else if (strcasecmp(p, "nofileid") == 0)
options[VOLOPT_FLAGS].i_value |= AFPVOL_NOFILEID;
+ else if (strcasecmp(p, "utf8") == 0)
+ options[VOLOPT_FLAGS].i_value |= AFPVOL_UTF8;
p = strtok(NULL, ",");
}
int c;
p = buf;
- while ((( c = getc( fp )) != EOF ) && ( size > 0 )) {
+ while ((EOF != ( c = getc( fp )) ) && ( size > 0 )) {
if ( c == '\n' || c == '\r' ) {
*p++ = '\n';
break;
strcat( path, p2 );
}
- if (( fp = fopen( path, "r" )) == NULL ) {
+ if (NULL == ( fp = fopen( path, "r" )) ) {
return( -1 );
}
}
/* FIXME
*/
- if (afp_version >= 30)
+ if (afp_version >= 30) {
volume->max_filename = 255;
- else
+ }
+ else {
volume->max_filename = MACFILELEN;
-
+ }
if (( volume->v_flags & AFPVOL_OPEN ) == 0 ) {
/* FIXME unix name != mac name */
if ((dir = dirnew(volume->v_name, volume->v_name) ) == NULL) {
*rbuflen = 0;
ibuf += 2;
memcpy(&vid, ibuf, sizeof( vid ));
- if (( vol = getvolbyvid( vid )) == NULL ) {
+ if (NULL == ( vol = getvolbyvid( vid )) ) {
return( AFPERR_PARAM );
}
curdir = ovol->v_dir;
}
}
-
dirfree( vol->v_root );
vol->v_dir = NULL;
#ifdef CNID_DB
char *p;
struct extmap *em;
- if (( p = strrchr( path, '.' )) == NULL ) {
+ if (NULL == ( p = strrchr( path, '.' )) ) {
return( defextmap );
}
p++;
if ( (vol->v_flags & AFPVOL_OPEN) && vol->v_time + 30 < tv.tv_sec) {
if ( !stat( vol->v_path, &st ) && vol->v_time != st.st_mtime ) {
vol->v_time = st.st_mtime;
- obj->attention(obj->handle, AFPATTN_NOTIFY | AFPATTN_VOLCHANGED);
+ if (!obj->attention(obj->handle, AFPATTN_NOTIFY | AFPATTN_VOLCHANGED))
+ return -1;
return 1;
}
}
memcpy(&bitmap, ibuf, sizeof( bitmap ));
bitmap = ntohs( bitmap );
- if (( vol = getvolbyvid( vid )) == NULL ) {
+ if (NULL == ( vol = getvolbyvid( vid )) ) {
*rbuflen = 0;
return( AFPERR_PARAM );
}