msdosfs_conv.c (277898) | msdosfs_conv.c (298074) |
---|---|
1/* $FreeBSD: head/sys/fs/msdosfs/msdosfs_conv.c 277898 2015-01-29 20:30:13Z dim $ */ | 1/* $FreeBSD: head/sys/fs/msdosfs/msdosfs_conv.c 298074 2016-04-15 17:28:24Z pfg $ */ |
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 * --- 338 unchanged lines hidden (view full) --- 348 * Now find the extension 349 * Note: dot as first char doesn't start extension 350 * and trailing dots and blanks are ignored 351 * Note(2003/7): It seems recent Windows has 352 * defferent rule than this code, that Windows 353 * ignores all dots before extension, and use all 354 * chars as filename except for dots. 355 */ | 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 * --- 338 unchanged lines hidden (view full) --- 348 * Now find the extension 349 * Note: dot as first char doesn't start extension 350 * and trailing dots and blanks are ignored 351 * Note(2003/7): It seems recent Windows has 352 * defferent rule than this code, that Windows 353 * ignores all dots before extension, and use all 354 * chars as filename except for dots. 355 */ |
356 dp = dp1 = 0; | 356 dp = dp1 = NULL; |
357 for (cp = un + 1, i = unlen - 1; --i >= 0;) { 358 switch (*cp++) { 359 case '.': 360 if (!dp1) 361 dp1 = cp; 362 break; 363 case ' ': 364 break; 365 default: 366 if (dp1) 367 dp = dp1; | 357 for (cp = un + 1, i = unlen - 1; --i >= 0;) { 358 switch (*cp++) { 359 case '.': 360 if (!dp1) 361 dp1 = cp; 362 break; 363 case ' ': 364 break; 365 default: 366 if (dp1) 367 dp = dp1; |
368 dp1 = 0; | 368 dp1 = NULL; |
369 break; 370 } 371 } 372 373 /* 374 * Now convert it (this part is for extension). 375 * As Windows XP do, if it's not ascii char, 376 * this function should return 2 or 3, so that checkng out Unicode name. --- 688 unchanged lines hidden --- | 369 break; 370 } 371 } 372 373 /* 374 * Now convert it (this part is for extension). 375 * As Windows XP do, if it's not ascii char, 376 * this function should return 2 or 3, so that checkng out Unicode name. --- 688 unchanged lines hidden --- |