Deleted Added
full compact
msdosfs_conv.c (33791) msdosfs_conv.c (33848)
1/* $Id: msdosfs_conv.c,v 1.22 1998/02/23 16:44:27 ache Exp $ */
1/* $Id: msdosfs_conv.c,v 1.23 1998/02/24 14:13:11 ache Exp $ */
2/* $NetBSD: msdosfs_conv.c,v 1.25 1997/11/17 15:36:40 ws Exp $ */
3
4/*-
5 * Copyright (C) 1995, 1997 Wolfgang Solfrank.
6 * Copyright (C) 1995, 1997 TooLs GmbH.
7 * All rights reserved.
8 * Original code by Paul Popelka (paulp@uts.amdahl.com) (see below).
9 *

--- 980 unchanged lines hidden (view full) ---

990/*
991 * Determine the number of slots necessary for Win95 names
992 */
993int
994winSlotCnt(un, unlen)
995 const u_char *un;
996 int unlen;
997{
2/* $NetBSD: msdosfs_conv.c,v 1.25 1997/11/17 15:36:40 ws Exp $ */
3
4/*-
5 * Copyright (C) 1995, 1997 Wolfgang Solfrank.
6 * Copyright (C) 1995, 1997 TooLs GmbH.
7 * All rights reserved.
8 * Original code by Paul Popelka (paulp@uts.amdahl.com) (see below).
9 *

--- 980 unchanged lines hidden (view full) ---

990/*
991 * Determine the number of slots necessary for Win95 names
992 */
993int
994winSlotCnt(un, unlen)
995 const u_char *un;
996 int unlen;
997{
998 for (un += unlen; unlen > 0; unlen--)
999 if (*--un != ' ' && *un != '.')
1000 break;
998 unlen = winLenFixup(un, unlen);
1001 if (unlen > WIN_MAXLEN)
1002 return 0;
1003 return howmany(unlen, WIN_CHARS);
1004}
999 if (unlen > WIN_MAXLEN)
1000 return 0;
1001 return howmany(unlen, WIN_CHARS);
1002}
1003
1004/*
1005 * Determine the number of bytes neccesary for Win95 names
1006 */
1007int
1008winLenFixup(un, unlen)
1009 const u_char* un;
1010 int unlen;
1011{
1012 for (un += unlen; unlen > 0; unlen--)
1013 if (*--un != ' ' && *un != '.')
1014 break;
1015 return unlen;
1016}