]> wimlib.net Git - wimlib/commitdiff
Allow adding an unnamed image
authorEric Biggers <ebiggers3@gmail.com>
Tue, 21 May 2013 17:19:51 +0000 (12:19 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Tue, 21 May 2013 17:19:51 +0000 (12:19 -0500)
include/wimlib.h
src/add_image.c

index b5dcd96dfd3b72ad1fd388dc0460db7ccd5c4f60..e021906106e75465e2465db482693a50770fdc3c 100644 (file)
@@ -994,15 +994,15 @@ enum wimlib_error_code {
  *     Pointer to the ::WIMStruct for the WIM file to which the image is to be
  *     added.
  * @param name
  *     Pointer to the ::WIMStruct for the WIM file to which the image is to be
  *     added.
  * @param name
- *     Name to give the new image.
+ *     Name to give the new image.  If @c NULL or empty, the new image is given
+ *     no name.  If nonempty, it must specify a name that does not already
+ *     exist in @a wim.
  * @param new_idx_ret
  *     If non-<code>NULL</code>, the index of the newly added image is returned
  *     in this location.
  *
  * @return 0 on success; nonzero on failure.  The possible error codes are:
  *
  * @param new_idx_ret
  *     If non-<code>NULL</code>, the index of the newly added image is returned
  *     in this location.
  *
  * @return 0 on success; nonzero on failure.  The possible error codes are:
  *
- * @retval ::WIMLIB_ERR_INVALID_PARAM
- *     @a name was @c NULL or an empty string.
  * @retval ::WIMLIB_ERR_SPLIT_UNSUPPORTED
  *     @a wim is part of a split WIM.
  * @retval ::WIMLIB_ERR_IMAGE_NAME_COLLISION
  * @retval ::WIMLIB_ERR_SPLIT_UNSUPPORTED
  *     @a wim is part of a split WIM.
  * @retval ::WIMLIB_ERR_IMAGE_NAME_COLLISION
@@ -1037,8 +1037,9 @@ wimlib_add_empty_image(WIMStruct *wim,
  *     A path to a directory or unmounted NTFS volume that will be captured as
  *     a WIM image.
  * @param name
  *     A path to a directory or unmounted NTFS volume that will be captured as
  *     a WIM image.
  * @param name
- *     The name to give the image.  It must be nonempty and must specify a name
- *     that does not yet exist in @a wim.
+ *     Name to give the new image.  If @c NULL or empty, the new image is given
+ *     no name.  If nonempty, it must specify a name that does not already
+ *     exist in @a wim.
  * @param config
  *     Capture configuration that specifies files, directories, or path globs
  *     to exclude from being captured.  If @c NULL, a dummy configuration where
  * @param config
  *     Capture configuration that specifies files, directories, or path globs
  *     to exclude from being captured.  If @c NULL, a dummy configuration where
index caffafebd23de4935cd2bd4d84591b8dc1cc779e..7dcee10b01a4a55ac2ded3dad802dd2007fe5c73 100644 (file)
@@ -77,11 +77,8 @@ wimlib_add_empty_image(WIMStruct *wim, const tchar *name, int *new_idx_ret)
 
        DEBUG("Adding empty image \"%"TS"\"", name);
 
 
        DEBUG("Adding empty image \"%"TS"\"", name);
 
-       if (name == NULL || name[0] == T('\0')) {
-               ERROR("Must specify a non-empty string for the image name");
-               ret = WIMLIB_ERR_INVALID_PARAM;
-               goto out;
-       }
+       if (name == NULL)
+               name = T("");
 
        if (wim->hdr.total_parts != 1) {
                ERROR("Cannot add an image to a split WIM");
 
        if (wim->hdr.total_parts != 1) {
                ERROR("Cannot add an image to a split WIM");